NCBACK-9 #7
@@ -66,7 +66,13 @@ public class ApiController {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
log.error("Handler execution failed for msgId: {}", msgId, e);
|
||||
throw new RuntimeException("Handler execution failed", e);
|
||||
|
||||
BaseResponse errorResponse = new BaseResponse(msgId,
|
||||
MessageCode.INVALID_JSON_BODY.getCode(),
|
||||
MessageCode.INVALID_JSON_BODY.getDescription(),
|
||||
new HashMap<>());
|
||||
|
||||
return ResponseEntity.ok().body(errorResponse);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ public enum MessageCode {
|
||||
SUCCESS(0, "Operation successful"),
|
||||
REG_EMAIL_EXISTS(1, "Email already registered"),
|
||||
INVALID_FIELD(2, "Invalid field"),
|
||||
INVALID_JSON_BODY(2, "Invalid fields in JSON object"),
|
||||
MSG_ID_NOT_FOUND(4, "Message id not found"),
|
||||
|
||||
AUTH_EMAIL_NOT_FOUND(4, "Email not found"),
|
||||
|
||||
Reference in New Issue
Block a user