Remove fields in the CodeException. The code and associated message are held in the response embedded in the superclass.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@161925 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Manuele Simi 2017-12-29 03:25:00 +00:00
parent 77b0722bf1
commit 38feed8fdb
1 changed files with 0 additions and 16 deletions

View File

@ -13,29 +13,13 @@ public class CodeException extends WebApplicationException {
private static final long serialVersionUID = 333945715086602250L;
private final int errorCode;
private final String errorMsg;
public CodeException(Response.Status status, ErrorCode code) {
super(Response.status(status).entity(new CodeEntity(new SerializableErrorCode(code.getId(), code.getMessage())))
.build());
this.errorMsg = code.getMessage();
this.errorCode = code.getId();
}
public CodeException(ErrorCode code) {
super(Response.status(Response.Status.NOT_ACCEPTABLE)
.entity(new CodeEntity(new SerializableErrorCode(code.getId(), code.getMessage()))).build());
this.errorMsg = code.getMessage();
this.errorCode = code.getId();
}
public int getErrorCode() {
return errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
}