-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Develop
- Loading branch information
Showing
35 changed files
with
387 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
Pod::Spec.new do |s| | ||
s.name = "BVSDK" | ||
s.version = '8.13.2' | ||
s.version = '8.13.3' | ||
s.homepage = 'https://developer.bazaarvoice.com/' | ||
s.license = { :type => 'Commercial', :text => 'See https://developer.bazaarvoice.com/API_Terms_of_Use' } | ||
s.author = { 'Bazaarvoice' => '[email protected]' } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
BVSDK/BVProductSentiments/Sentiments/Errors/BVProductSentimentsError.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// BVProductSentimentsError.h | ||
// BVSDK | ||
// | ||
// Copyright © 2025 Bazaarvoice. All rights reserved. | ||
// | ||
|
||
#ifndef BVProductSentimentsError_h | ||
#define BVProductSentimentsError_h | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#define BVKeyPSErrorDomainCode @(999) | ||
|
||
extern NSString *__nonnull const BVKeyPSStatusCode; | ||
extern NSString *__nonnull const BVKeyPSErrorCode; | ||
extern NSString *__nonnull const BVKeyPSErrorMessage; | ||
|
||
@interface BVProductSentimentsError : NSObject | ||
|
||
@property(nonnull) NSString *message; | ||
@property(nonnull) NSString *code; | ||
@property(nonnull) NSString *status; | ||
|
||
- (nonnull id)initWithApiResponse:(nonnull NSDictionary *)apiResponse | ||
statusCode:(nonnull NSString *) statusCode; | ||
- (nonnull NSError *)toNSError; | ||
|
||
@end | ||
|
||
|
||
#endif /* BVProductSentimentsError_h */ |
45 changes: 45 additions & 0 deletions
45
BVSDK/BVProductSentiments/Sentiments/Errors/BVProductSentimentsError.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// BVProductSentimentsError.m | ||
// BVSDK | ||
// | ||
// Copyright © 2025 Bazaarvoice. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "BVProductSentimentsError.h" | ||
#import "BVCommon.h" | ||
#import "BVNullHelper.h" | ||
|
||
NSString *__nonnull const BVKeyPSStatusCode = @"BVKeyPSStatusCode"; | ||
NSString *__nonnull const BVKeyPSErrorCode = @"BVKeyPSErrorCode"; | ||
NSString *__nonnull const BVKeyPSErrorMessage = @"BVKeyPSErrorMessage"; | ||
|
||
@implementation BVProductSentimentsError | ||
|
||
- (nonnull id)initWithApiResponse:(nonnull NSDictionary *)apiResponse statusCode:(nonnull NSString *)statusCode { | ||
if ((self = [super init])) { | ||
self.status = statusCode; | ||
self.code = @"N/A"; | ||
self.message = @"N/A"; | ||
|
||
SET_IF_NOT_NULL_WITH_ALTERNATE(self.code, apiResponse[@"code"], apiResponse[@"title"]) | ||
SET_IF_NOT_NULL_WITH_ALTERNATE(self.message, apiResponse[@"message"], apiResponse[@"detail"]) | ||
} | ||
return self; | ||
} | ||
|
||
- (nonnull NSError *)toNSError { | ||
NSString *description = | ||
[NSString stringWithFormat:@"%@: %@\n%@", self.status, self.code, self.message]; | ||
return [NSError errorWithDomain:BVErrDomain | ||
code:BVKeyPSErrorDomainCode.integerValue | ||
userInfo:@{ | ||
NSLocalizedDescriptionKey : description, | ||
BVKeyPSStatusCode : self.status, | ||
BVKeyPSErrorCode : self.message, | ||
BVKeyPSErrorMessage : self.code | ||
}]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.