Throw ApiException when adding contact is not successful

This commit is contained in:
Torsten Grote
2022-01-07 10:22:22 -03:00
parent e52c5ddc8e
commit f400cf5aa0
2 changed files with 2 additions and 4 deletions

View File

@@ -108,7 +108,7 @@ class MailboxApiImpl implements MailboxApi {
OkHttpClient client = httpClientProvider.get();
Response response = client.newCall(request).execute();
if (response.code() == 409) throw new TolerableFailureException();
if (!response.isSuccessful()) throw new IOException();
if (!response.isSuccessful()) throw new ApiException();
}
private Request.Builder getRequestBuilder(String token) {