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:
parent
77b0722bf1
commit
38feed8fdb
|
@ -13,29 +13,13 @@ public class CodeException extends WebApplicationException {
|
||||||
|
|
||||||
private static final long serialVersionUID = 333945715086602250L;
|
private static final long serialVersionUID = 333945715086602250L;
|
||||||
|
|
||||||
private final int errorCode;
|
|
||||||
private final String errorMsg;
|
|
||||||
|
|
||||||
public CodeException(Response.Status status, ErrorCode code) {
|
public CodeException(Response.Status status, ErrorCode code) {
|
||||||
super(Response.status(status).entity(new CodeEntity(new SerializableErrorCode(code.getId(), code.getMessage())))
|
super(Response.status(status).entity(new CodeEntity(new SerializableErrorCode(code.getId(), code.getMessage())))
|
||||||
.build());
|
.build());
|
||||||
this.errorMsg = code.getMessage();
|
|
||||||
this.errorCode = code.getId();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodeException(ErrorCode code) {
|
public CodeException(ErrorCode code) {
|
||||||
super(Response.status(Response.Status.NOT_ACCEPTABLE)
|
super(Response.status(Response.Status.NOT_ACCEPTABLE)
|
||||||
.entity(new CodeEntity(new SerializableErrorCode(code.getId(), code.getMessage()))).build());
|
.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue