You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NSString *debugFormat = [RFAPI localizedStringForKey:@"RFAPI.Debug.CannotJoinPathToBaseURL"value:@"Unable to join path %1$@ to %2$@, please check the API define"];
103
104
RFAPILogError_(debugFormat, path, define.baseURL)
105
+
#endif
104
106
if (error) {
105
107
*error = [RFAPI localizedErrorWithDoomain:NSURLErrorDomaincode:NSURLErrorBadURL underlyingError:nildescriptionKey:@"RFAPI.Error.CannotCreateRequestDescription"descriptionValue:@"Internal error, unable to create request"reasonKey:@"RFAPI.Error.CannotCreateRequestReason"reasonValue:@"It seems to be an application bug"suggestionKey:@"RFAPI.Error.CannotCreateRequestSuggestion"suggestionValue:@"Please try again. If it still doesn't work, try restarting the application"url:nil];
if (![responseObject isKindOfClass:NSDictionary.class]) {
14
+
#if RFDEBUG
14
15
NSString *debugFormat = [RFAPI localizedStringForKey:@"RFAPI.Debug.ObjectResponseTypeMismatchClass"value:@"Server response is %@ other than a dictionary\nPlease check your code first, then contart the server staff if the sever does not return as required"];
15
16
RFAPILogError_(debugFormat, responseObject.class)
17
+
#endif
16
18
*error = [selfbadResponseError:nil];
17
19
returnnil;
18
20
}
19
21
20
22
NSError *e = nil;
21
23
id JSONModelObject = [(JSONModel *)[modelClass alloc] initWithDictionary:responseObject error:&e];
22
24
if (!JSONModelObject) {
25
+
#if RFDEBUG
23
26
NSString *debugFormat = [RFAPI localizedStringForKey:@"RFAPI.Debug.ObjectResponseConvertToModelError"value:@"Cannot convert response to model: %@\nPlease check your code first, then contart the server staff if the sever does not return as required"];
24
27
RFAPILogError_(debugFormat, e)
28
+
#endif
25
29
*error = [selfbadResponseError:e];
26
30
}
27
31
return JSONModelObject;
28
32
}
29
33
case RFAPIDefineResponseExpectObjects: {
30
34
NSArray *responseObject = response;
31
35
if (![responseObject isKindOfClass:NSArray.class]) {
36
+
#if RFDEBUG
32
37
NSString *debugFormat = [RFAPI localizedStringForKey:@"RFAPI.Debug.ArrayResponseTypeMismatchClass"value:@"Server response is %@ other than an array\nPlease check your code first, then contart the server staff if the sever does not return as required"];
NSString *debugFormat = [RFAPI localizedStringForKey:@"RFAPI.Debug.ObjectResponseConvertToModelError"value:@"Cannot convert elements in the array to model: %@\nPlease check your code first, then contart the server staff if the sever does not return as required"];
NSError *error = [self.class localizedErrorWithDoomain:NSURLErrorDomaincode:NSURLErrorCancelled underlyingError:e descriptionKey:@"RFAPI.Error.CannotCreateRequest"descriptionValue:@"Internal error, unable to create request"reasonKey:@"RFAPI.Error.CannotCreateRequestReason"reasonValue:@"It seems to be an application bug"suggestionKey:@"RFAPI.Error.CannotCreateRequestSuggestion"suggestionValue:@"Please try again. If it still doesn't work, try restarting the application"url:request.URL];
0 commit comments