fix: return numeric api response codes
parent
bdc2bed8a6
commit
dbf45e5902
@ -1,10 +1,20 @@
|
||||
package com.yau.digitalrmb.shared.api;
|
||||
|
||||
public enum ErrorCode {
|
||||
SUCCESS,
|
||||
VALIDATION_ERROR,
|
||||
UNAUTHORIZED,
|
||||
FORBIDDEN,
|
||||
RESOURCE_NOT_FOUND,
|
||||
INTERNAL_ERROR
|
||||
SUCCESS(200),
|
||||
VALIDATION_ERROR(400),
|
||||
UNAUTHORIZED(401),
|
||||
FORBIDDEN(403),
|
||||
RESOURCE_NOT_FOUND(404),
|
||||
INTERNAL_ERROR(500);
|
||||
|
||||
private final int code;
|
||||
|
||||
ErrorCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue