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:
Manuele Simi 2017-12-28 05:14:55 +00:00
parent 33c6212530
commit 77b0722bf1
1 changed files with 2 additions and 2 deletions

View File

@ -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();