diff options
author | Morgan Chen <morganchen12@gmail.com> | 2018-06-28 12:02:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-28 12:02:16 -0700 |
commit | 7aa852fb234f8cc3ece5aa5cff5a53518249f3f0 (patch) | |
tree | cb8b47dba0801092cab5ba6cc4edb324374cb46d /Firebase/Auth/Source/FIRAuthErrorUtils.h | |
parent | bb9fd3136b189456606c8ece7ee1f2e9b1590e55 (diff) | |
parent | 21116161f92eda06389daaef670aa593aa588bcd (diff) |
Merge pull request #1436 from morganchen12/auth2
Add informative error to JWT parse failures
Diffstat (limited to 'Firebase/Auth/Source/FIRAuthErrorUtils.h')
-rw-r--r-- | Firebase/Auth/Source/FIRAuthErrorUtils.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Firebase/Auth/Source/FIRAuthErrorUtils.h b/Firebase/Auth/Source/FIRAuthErrorUtils.h index 5b8205f..6cc22ab 100644 --- a/Firebase/Auth/Source/FIRAuthErrorUtils.h +++ b/Firebase/Auth/Source/FIRAuthErrorUtils.h @@ -85,6 +85,19 @@ NS_ASSUME_NONNULL_BEGIN */ + (NSError *)unexpectedErrorResponseWithDeserializedResponse:(id)deserializedResponse; +/** @fn malformedJWTErrorWithToken:underlyingError: + @brief Constructs an @c NSError with the code set to @c FIRAuthErrorCodeMalformedJWT and + populates the userInfo dictionary with an error message, the bad token, and an underlying + error that may have occurred when parsing. + @param token The token that failed to parse. + @param underlyingError The error that caused this error. If this parameter is nil, the + NSUnderlyingErrorKey value will not be set. + @remarks This error is returned when JWT parsing fails. + @returns An @c FIRAuthErrorCodeMalformedJWT error wrapping an underlying error, if available. + */ ++ (NSError *)malformedJWTErrorWithToken:(NSString *)token + underlyingError:(NSError *_Nullable)underlyingError; + /** @fn unexpectedResponseWithData:underlyingError: @brief Constructs an @c NSError with the @c FIRAuthInternalErrorCodeUnexpectedResponse code, and a populated @c FIRAuthErrorUserInfoDataKey key in the @c NSError.userInfo |