Initialize CodeException from ErrorCode instead of RMCode.
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@161923 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
33c6212530
commit
77b0722bf1
|
@ -16,14 +16,14 @@ public class CodeException extends WebApplicationException {
|
|||
private final int errorCode;
|
||||
private final String errorMsg;
|
||||
|
||||
public CodeException(Response.Status status, RMCode code) {
|
||||
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(RMCode code) {
|
||||
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();
|
||||
|
|
Reference in New Issue