Convenience methods for creating standardized NSError
instances.
More...
#import <OIDErrorUtilities.h>
Convenience methods for creating standardized NSError
instances.
◆ errorWithCode:underlyingError:description:()
+ (NSError *) errorWithCode: |
|
(OIDErrorCode) |
code |
underlyingError: |
|
(nullable NSError *) |
underlyingError |
description: |
|
(nullable NSString *) |
description |
|
|
| |
Creates a standard NSError
from an OIDErrorCode
and custom user info. Automatically populates the localized error description.
- Parameters
-
code | The error code. |
underlyingError | The underlying error which occurred, if applicable. |
description | A custom description, if applicable. |
- Returns
- An
NSError
representing the error code.
◆ HTTPErrorWithHTTPResponse:data:()
+ (NSError *) HTTPErrorWithHTTPResponse: |
|
(NSHTTPURLResponse *) |
HTTPURLResponse |
data: |
|
(nullable NSData *) |
data |
|
|
| |
Creates a standard NSError
from an NSHTTPURLResponse
. Automatically populates the localized error description with the response data associated with the NSHTTPURLResponse
, if available.
- Parameters
-
HTTPURLResponse | The response which indicates an error occurred. |
data | The response data associated with the response which should be converted to an NSString assuming a UTF-8 encoding, if available. |
- Returns
- An
NSError
representing the error.
◆ isOAuthErrorDomain:()
+ (BOOL) isOAuthErrorDomain: |
|
(NSString *) |
errorDomain |
|
◆ OAuthErrorCodeFromString:()
◆ OAuthErrorWithDomain:OAuthResponse:underlyingError:()
+ (NSError *) OAuthErrorWithDomain: |
|
(NSString *) |
OAuthErrorDomain |
OAuthResponse: |
|
(NSDictionary *) |
errorResponse |
underlyingError: |
|
(nullable NSError *) |
underlyingError |
|
|
| |
◆ raiseException:()
+ (void) raiseException: |
|
(NSString *) |
name |
|
Raises an exception with the given name as both the name, and the message.
- Parameters
-
name | The name of the exception. |
◆ raiseException:message:()
Raises an exception with the given name and message.
- Parameters
-
name | The name of the exception. |
message | The message of the exception. |
◆ resourceServerAuthorizationErrorWithCode:errorResponse:underlyingError:()
+ (NSError *) resourceServerAuthorizationErrorWithCode: |
|
(NSInteger) |
code |
errorResponse: |
|
(nullable NSDictionary *) |
errorResponse |
underlyingError: |
|
(nullable NSError *) |
underlyingError |
|
|
| |
Creates a NSError
indicating that the resource server responded with an authorization error.
- Parameters
-
code | Your error code. |
errorResponse | The resource server error response, if any. |
underlyingError | The underlying error which occurred, if applicable. |
- Returns
- An
NSError
representing the authorization error from the resource server.
The documentation for this class was generated from the following file: