NCBACK-9 #7

Merged
backdev merged 12 commits from NCBACK-9 into dev 2025-12-17 13:41:28 +08:00
2 changed files with 8 additions and 1 deletions
Showing only changes of commit 0635b9b4ac - Show all commits
@@ -66,7 +66,13 @@ public class ApiController {
throw e; throw e;
} catch (Exception e) { } catch (Exception e) {
log.error("Handler execution failed for msgId: {}", msgId, 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"), SUCCESS(0, "Operation successful"),
REG_EMAIL_EXISTS(1, "Email already registered"), REG_EMAIL_EXISTS(1, "Email already registered"),
INVALID_FIELD(2, "Invalid field"), INVALID_FIELD(2, "Invalid field"),
INVALID_JSON_BODY(2, "Invalid fields in JSON object"),
MSG_ID_NOT_FOUND(4, "Message id not found"), MSG_ID_NOT_FOUND(4, "Message id not found"),
AUTH_EMAIL_NOT_FOUND(4, "Email not found"), AUTH_EMAIL_NOT_FOUND(4, "Email not found"),