Update PelayananController.java

Penyesuaian json response data saat handle exception
This commit is contained in:
Salman Manoe 2023-08-22 07:34:15 +07:00
parent d7803b01a7
commit ead40e7dec

View File

@ -250,7 +250,7 @@ public class PelayananController extends LocaleController<PelayananPasienVO> {
LOGGER.error("Got exception {} when check voucher validity", e.getMessage()); LOGGER.error("Got exception {} when check voucher validity", e.getMessage());
Map<String, String> error = new HashMap<>(); Map<String, String> error = new HashMap<>();
error.put("bad_request", e.getMessage()); error.put("bad_request", e.getMessage());
return RestUtil.getJsonResponse(null, HttpStatus.BAD_REQUEST, error); return RestUtil.getJsonResponse(false, HttpStatus.BAD_REQUEST, error);
} catch (JpaSystemException jse) { } catch (JpaSystemException jse) {
LOGGER.error("Got exception {} when check voucher validity", jse.getMessage()); LOGGER.error("Got exception {} when check voucher validity", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage()); addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());