diff options
author | Vitaly Takmazov | 2020-09-16 02:29:15 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-09-16 02:29:15 +0300 |
commit | 08e26c13ab22fd07442d2323ba98a7b6cb56dc8a (patch) | |
tree | 290ca796565bd34f2f1a074662b317429a3f9882 /Juick/Model | |
parent | dae781183522e43f04726bb07a9b7ae7b88a8f9e (diff) |
Add more url info in error alert
Diffstat (limited to 'Juick/Model')
-rw-r--r-- | Juick/Model/User.h | 2 | ||||
-rw-r--r-- | Juick/Model/User.m | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Juick/Model/User.h b/Juick/Model/User.h index 344626e..4bbf332 100644 --- a/Juick/Model/User.h +++ b/Juick/Model/User.h @@ -17,6 +17,6 @@ + (User *) fromJSON:(NSDictionary *)jsonData; -+ (void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error; ++ (void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error path:(NSString *)path params:(NSDictionary *)params; @end diff --git a/Juick/Model/User.m b/Juick/Model/User.m index a0c34f9..f9b2990 100644 --- a/Juick/Model/User.m +++ b/Juick/Model/User.m @@ -20,11 +20,11 @@ return user; } -+(void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error { ++(void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error path:(NSString *)path params:(NSDictionary *)params { UIAlertController *alert = [UIAlertController new]; NSString *title = error.userInfo[@"url"] ? error.userInfo[@"url"] : @"Something went wrong"; [alert setTitle:title]; - [alert setMessage:error.localizedDescription]; + [alert setMessage:[NSString stringWithFormat:@"err: %@, path: %@, params: %@", error.localizedDescription, path, params]]; [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]]; UIPopoverPresentationController *popover = [alert popoverPresentationController]; if (popover) { |