...
|
...
|
@@ -102,7 +102,6 @@ |
|
|
|
|
|
- (void)reportUploadError:(AFHTTPRequestOperation *)operation withResponse:(id)responseObject
|
|
|
{
|
|
|
#ifdef APPYOHO
|
|
|
if (operation.response.statusCode == 200) {
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -112,7 +111,7 @@ |
|
|
NSString *body = [[NSString alloc] initWithData:operation.request.HTTPBody encoding:NSUTF8StringEncoding];
|
|
|
id response = nil;
|
|
|
|
|
|
if (IsDictionaryClass(responseObject)) {
|
|
|
if (YAIsDictionaryClass(responseObject)) {
|
|
|
response = responseObject;
|
|
|
} else {
|
|
|
response = [responseObject description];
|
...
|
...
|
@@ -126,32 +125,30 @@ |
|
|
parameters[JsonKeyErrorEC] = @(code);
|
|
|
}
|
|
|
|
|
|
if (!IsStrEmpty(url)) {
|
|
|
if (!YAIsStrEmpty(url)) {
|
|
|
parameters[JsonKeyErrorEI] = url;
|
|
|
}
|
|
|
if (!IsStrEmpty(method)) {
|
|
|
if (!YAIsStrEmpty(method)) {
|
|
|
parameters[JsonKeyErrorMethod] = method;
|
|
|
}
|
|
|
if (!IsStrEmpty(body)) {
|
|
|
if (!YAIsStrEmpty(body)) {
|
|
|
parameters[JsonKeyErrorBody] = body;
|
|
|
}
|
|
|
if (!IsNilOrNull(response)) {
|
|
|
if (!YAIsNilOrNull(response)) {
|
|
|
parameters[JsonKeyErrorResponse] = response;
|
|
|
}
|
|
|
[[YH_Analytics sharedInstance] logError:kErrorTypeREPORT parameters:parameters];
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
- (void)reportUplaodError:(AFHTTPRequestOperation *)operation withError:(NSError *)error
|
|
|
{
|
|
|
#ifdef APPYOHO
|
|
|
if (!error) {
|
|
|
return;
|
|
|
}
|
|
|
NSString *url = operation.request.URL.absoluteString;
|
|
|
NSString *method = [operation.request.HTTPMethod uppercaseString];
|
|
|
NSString *body = [[NSString alloc] initWithData:operation.request.HTTPBody encoding:NSUTF8StringEncoding];
|
|
|
NSString *response = (*error).localizedDescription;
|
|
|
NSString *response = error.localizedDescription;
|
|
|
NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
|
|
|
//超时返回是0,但是为了和android的统一性,ios修改成-1。
|
|
|
if (operation.response.statusCode == 0) {
|
...
|
...
|
@@ -160,20 +157,20 @@ |
|
|
parameters[JsonKeyErrorEC] = @(operation.response.statusCode);
|
|
|
}
|
|
|
|
|
|
if (!IsStrEmpty(url)) {
|
|
|
if (!YAIsStrEmpty(url)) {
|
|
|
parameters[JsonKeyErrorEI] = url;
|
|
|
}
|
|
|
if (!IsStrEmpty(method)) {
|
|
|
if (!YAIsStrEmpty(method)) {
|
|
|
parameters[JsonKeyErrorMethod] = method;
|
|
|
}
|
|
|
if (!IsStrEmpty(body)) {
|
|
|
if (!YAIsStrEmpty(body)) {
|
|
|
parameters[JsonKeyErrorBody] = body;
|
|
|
}
|
|
|
if (!IsStrEmpty(response)) {
|
|
|
if (!YAIsStrEmpty(response)) {
|
|
|
parameters[JsonKeyErrorResponse] = response;
|
|
|
}
|
|
|
[[YH_Analytics sharedInstance] logError:kErrorTypeREPORT parameters:parameters];
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
- (AFHTTPRequestOperation *)uploadLogcustomURL:(NSString *)url parameters:(NSDictionary *)parameters completionBlock:(void (^)(BOOL success, NSError *error))block
|
...
|
...
|
|