mirror of
https://github.com/etesync/android
synced 2024-12-23 07:08:16 +00:00
Add a separate exception for HttpConflict.
This commit is contained in:
parent
fe980f937e
commit
1d5bcc6a3d
@ -34,6 +34,7 @@ abstract class BaseManager {
|
||||
HttpURLConnection.HTTP_BAD_GATEWAY -> throw Exceptions.BadGatewayException(response, "Bad gateway: most likely a server restart")
|
||||
HttpURLConnection.HTTP_UNAVAILABLE -> throw Exceptions.ServiceUnavailableException(response, "Service unavailable")
|
||||
HttpURLConnection.HTTP_UNAUTHORIZED -> throw Exceptions.UnauthorizedException(response, "Unauthorized auth token")
|
||||
HttpURLConnection.HTTP_CONFLICT -> throw Exceptions.ConflictException(response, "Http conflict")
|
||||
HttpURLConnection.HTTP_FORBIDDEN -> {
|
||||
if (apiError.code == "service_inactive") {
|
||||
throw Exceptions.UserInactiveException(response, apiError.detail)
|
||||
|
@ -10,6 +10,8 @@ import java.security.GeneralSecurityException
|
||||
class Exceptions {
|
||||
class AssociateNotAllowedException(response: Response, message: String?) : HttpException(response, message)
|
||||
|
||||
class ConflictException(response: Response, message: String?) : IgnorableHttpException(response, message ?: "Conflict exception")
|
||||
|
||||
class ReadOnlyException(response: Response, message: String?) : HttpException(response, message)
|
||||
|
||||
class UnauthorizedException(response: Response, message: String?) : HttpException(response, message)
|
||||
|
Loading…
Reference in New Issue
Block a user