Skip to content

Commit

Permalink
feat: handle HTTP 423 Locked (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
malteo authored Feb 28, 2024
1 parent e36944b commit 1ef7897
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.cloudesire.platform.apiclient.exceptions.BadRequestException;
import com.cloudesire.platform.apiclient.exceptions.ConflictException;
import com.cloudesire.platform.apiclient.exceptions.InternalServerErrorException;
import com.cloudesire.platform.apiclient.exceptions.LockedException;
import com.cloudesire.platform.apiclient.exceptions.MethodNotAllowedException;
import com.cloudesire.platform.apiclient.exceptions.NetworkException;
import com.cloudesire.platform.apiclient.exceptions.ResourceNotFoundException;
Expand Down Expand Up @@ -83,6 +84,7 @@ private <T> RuntimeException exceptionHandling( retrofit2.Response<T> response )
case 405: return new MethodNotAllowedException( errorMessage, error );
case 409: return new ConflictException( errorMessage, error );
case 422: return new UnprocessableEntityException( errorMessage, error );
case 423: return new LockedException( errorMessage, error );
case 500: return new InternalServerErrorException( errorMessage, error );
default: return new BackendException( errorMessage, error );
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.cloudesire.platform.apiclient.exceptions;

import com.cloudesire.platform.apiclient.response.error.ErrorResponse;

public class LockedException extends BackendException
{
public LockedException( String message, ErrorResponse error )
{
super( message, error );
}
}

0 comments on commit 1ef7897

Please sign in to comment.