diff options
Diffstat (limited to 'mullvad-api')
| -rw-r--r-- | mullvad-api/src/lib.rs | 3 | ||||
| -rw-r--r-- | mullvad-api/src/rest.rs | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/mullvad-api/src/lib.rs b/mullvad-api/src/lib.rs index 9c23fea6a7..714718814b 100644 --- a/mullvad-api/src/lib.rs +++ b/mullvad-api/src/lib.rs @@ -47,6 +47,9 @@ pub const INVALID_VOUCHER: &str = "INVALID_VOUCHER"; /// Error code returned by the Mullvad API if the account token is invalid. pub const INVALID_ACCOUNT: &str = "INVALID_ACCOUNT"; +/// Error code returned by the Mullvad API if the device does not exist. +pub const DEVICE_NOT_FOUND: &str = "DEVICE_NOT_FOUND"; + /// Error code returned by the Mullvad API if the access token is invalid. pub const INVALID_ACCESS_TOKEN: &str = "INVALID_ACCESS_TOKEN"; diff --git a/mullvad-api/src/rest.rs b/mullvad-api/src/rest.rs index 517e0b3a03..d174c3d19c 100644 --- a/mullvad-api/src/rest.rs +++ b/mullvad-api/src/rest.rs @@ -584,7 +584,6 @@ pub async fn parse_rest_response( pub async fn handle_error_response<T>(response: Response) -> Result<T> { let status = response.status(); let error_message = match status { - hyper::StatusCode::NOT_FOUND => "Not found", hyper::StatusCode::METHOD_NOT_ALLOWED => "Method not allowed", status => match get_body_length(&response) { 0 => status.canonical_reason().unwrap_or("Unexpected error"), |
