@@ -50,9 +50,7 @@ @implementation QCloudCOSXMLService
5050+ (QCloudCOSXMLService *)defaultCOSXML {
5151 @synchronized (self) {
5252 if (!COSXMLService) {
53- if (DEBUG) {
54- @throw [NSException exceptionWithName: QCloudErrorDomain reason: @" 您没有配置默认的OCR服务配置,请配置之后再调用该方法" userInfo: nil ];
55- }
53+ @throw [NSException exceptionWithName: QCloudErrorDomain reason: @" 您没有配置默认的OCR服务配置,请配置之后再调用该方法" userInfo: nil ];
5654 }
5755 return COSXMLService;
5856 }
@@ -61,13 +59,11 @@ + (QCloudCOSXMLService *)defaultCOSXML {
6159+ (QCloudCOSXMLService *)registerDefaultCOSXMLWithConfiguration : (QCloudServiceConfiguration *)configuration {
6260 @synchronized (self) {
6361 if (COSXMLService) {
64- if (DEBUG) {
65- @throw [NSException
66- exceptionWithName: QCloudErrorDomain
67- reason: [NSString stringWithFormat:
68- @" 默认的COSXMLService已存在,如有新的配置,请通过 registerCOSXMLWithConfiguration:withKey:重新注册" ]
69- userInfo: nil ];
70- }
62+ @throw [NSException
63+ exceptionWithName: QCloudErrorDomain
64+ reason: [NSString stringWithFormat:
65+ @" 默认的COSXMLService已存在,如有新的配置,请通过 registerCOSXMLWithConfiguration:withKey:重新注册" ]
66+ userInfo: nil ];
7167 }
7268 COSXMLService = [[QCloudCOSXMLService alloc ] initWithConfiguration: configuration];
7369 if (!configuration.isCloseShareLog ) {
@@ -82,11 +78,9 @@ + (QCloudCOSXMLService *)registerDefaultCOSXMLWithConfiguration:(QCloudServiceCo
8278+ (QCloudCOSXMLService *)cosxmlServiceForKey : (NSString *)key {
8379 QCloudCOSXMLService *cosxmlService = [QCloudCOSXMLServiceCache () objectForKey: key];
8480 if (!cosxmlService) {
85- if (DEBUG) {
86- @throw [NSException exceptionWithName: QCloudErrorDomain
87- reason: [NSString stringWithFormat: @" 您没有配置Key为%@ 的OCR服务配置,请配置之后再调用该方法" , key]
88- userInfo: nil ];
89- }
81+ @throw [NSException exceptionWithName: QCloudErrorDomain
82+ reason: [NSString stringWithFormat: @" 您没有配置Key为%@ 的OCR服务配置,请配置之后再调用该方法" , key]
83+ userInfo: nil ];
9084 }
9185 return cosxmlService;
9286}
@@ -98,14 +92,12 @@ + (void)removeCOSXMLWithKey:(NSString *)key {
9892+ (QCloudCOSXMLService *)registerCOSXMLWithConfiguration : (QCloudServiceConfiguration *)configuration withKey : (NSString *)key ;
9993{
10094 if ([self hasServiceForKey: key]) {
101- if (DEBUG) {
102- @throw [NSException
103- exceptionWithName: QCloudErrorDomain
104- reason: [NSString
105- stringWithFormat:
106- @" key: %@ COSXMLService已存在,如有新的配置,请通过 registerCOSXMLWithConfiguration:withKey:重新注册" , key]
107- userInfo: nil ];
108- }
95+ @throw [NSException
96+ exceptionWithName: QCloudErrorDomain
97+ reason: [NSString
98+ stringWithFormat:
99+ @" key: %@ COSXMLService已存在,如有新的配置,请通过 registerCOSXMLWithConfiguration:withKey:重新注册" , key]
100+ userInfo: nil ];
109101 }
110102 QCloudCOSXMLService *cosxmlService = [[QCloudCOSXMLService alloc ] initWithConfiguration: configuration];
111103 [QCloudCOSXMLServiceCache () setObject: cosxmlService forKey: key];
0 commit comments