This repository was archived by the owner on Aug 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -83,11 +83,22 @@ - (RACSignal *)remoteAccountWithSystemAccount:(ACAccount *)account {
8383 [subscriber sendCompleted ];
8484 }
8585 else {
86- [subscriber sendError: parseError];
86+ NSMutableDictionary *dictionary = [NSMutableDictionary new ];
87+ if (parseError) {
88+ dictionary[NSUnderlyingErrorKey ] = parseError;
89+ }
90+ NSError *error = [NSError errorWithDomain: SimpleAuthErrorDomain code: SimpleAuthErrorInvalidData userInfo: dictionary];
91+ [subscriber sendNext: error];
8792 }
8893 }
8994 else {
90- [subscriber sendError: connectionError];
95+ NSMutableDictionary *dictionary = [NSMutableDictionary new ];
96+ if (connectionError) {
97+ dictionary[NSUnderlyingErrorKey ] = connectionError;
98+ }
99+ dictionary[SimpleAuthErrorStatusCodeKey] = @(statusCode);
100+ NSError *error = [NSError errorWithDomain: SimpleAuthErrorDomain code: SimpleAuthErrorNetwork userInfo: dictionary];
101+ [subscriber sendError: error];
91102 }
92103 }];
93104 return nil ;
Original file line number Diff line number Diff line change @@ -357,11 +357,22 @@ - (RACSignal *)accountWithAccessToken:(NSDictionary *)accessToken {
357357 [subscriber sendCompleted ];
358358 }
359359 else {
360- [subscriber sendError: parseError];
360+ NSMutableDictionary *dictionary = [NSMutableDictionary new ];
361+ if (parseError) {
362+ dictionary[NSUnderlyingErrorKey ] = parseError;
363+ }
364+ NSError *error = [NSError errorWithDomain: SimpleAuthErrorDomain code: SimpleAuthErrorInvalidData userInfo: dictionary];
365+ [subscriber sendNext: error];
361366 }
362367 }
363368 else {
364- [subscriber sendError: connectionError];
369+ NSMutableDictionary *dictionary = [NSMutableDictionary new ];
370+ if (connectionError) {
371+ dictionary[NSUnderlyingErrorKey ] = connectionError;
372+ }
373+ dictionary[SimpleAuthErrorStatusCodeKey] = @(statusCode);
374+ NSError *error = [NSError errorWithDomain: SimpleAuthErrorDomain code: SimpleAuthErrorNetwork userInfo: dictionary];
375+ [subscriber sendError: error];
365376 }
366377 }];
367378 return nil ;
You can’t perform that action at this time.
0 commit comments