Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.ws.rs.core.Response;

/**
* ConstraintViolationException that includes RestException-like data to create a standard error
Expand All @@ -29,6 +28,8 @@
*/
public class RestConstraintViolationException extends ConstraintViolationException {

public static final int DEFAULT_ERROR_CODE =
ConstraintViolationExceptionMapper.UNPROCESSABLE_ENTITY_CODE;
private int errorCode;

public RestConstraintViolationException(String message, int errorCode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@

public class RestNotAuthorizedException extends RestException {

public static final int DEFAULT_ERROR_CODE = Response.Status.UNAUTHORIZED.getStatusCode();

public RestNotAuthorizedException(String message, int errorCode) {
super(message, Response.Status.UNAUTHORIZED.getStatusCode(), errorCode);
}

public RestNotAuthorizedException(String message, int errorCode, Throwable cause) {
super(message, Response.Status.UNAUTHORIZED.getStatusCode(), errorCode, cause);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class RestNotFoundException extends RestException {

public static final int DEFAULT_ERROR_CODE = Response.Status.NOT_FOUND.getStatusCode();

public RestNotFoundException(String message, int errorCode) {
super(message, Response.Status.NOT_FOUND.getStatusCode(), errorCode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class RestServerErrorException extends RestException {

public static final int DEFAULT_ERROR_CODE =
Response.Status.INTERNAL_SERVER_ERROR.getStatusCode();

public RestServerErrorException(String message, int errorCode) {
this(message, errorCode, null);
}
Expand Down