diff options
| -rw-r--r-- | ios/MullvadVPN/REST/RESTError.swift | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ios/MullvadVPN/REST/RESTError.swift b/ios/MullvadVPN/REST/RESTError.swift index e275a9ab34..175370563f 100644 --- a/ios/MullvadVPN/REST/RESTError.swift +++ b/ios/MullvadVPN/REST/RESTError.swift @@ -46,6 +46,14 @@ extension REST { return "Failure to decode URL response data." } } + + func compareErrorCode(_ code: ServerResponseCode) -> Bool { + if case .unhandledResponse(_, let serverResponse) = self { + return serverResponse?.code == code + } else { + return false + } + } } struct ServerErrorResponse: Decodable { |
