use of com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult in project ArachneCentralAPI by OHDSI.
the class ExceptionHandlingController method exceptionHandler.
@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
@ExceptionHandler(ServiceNotAvailableException.class)
@ResponseBody
public JsonResult exceptionHandler(ServiceNotAvailableException ex) {
LOGGER.warn(ex.getMessage());
JsonResult result = new JsonResult(SYSTEM_ERROR);
result.setErrorMessage(ex.getMessage());
return result;
}
use of com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult in project ArachneCentralAPI by OHDSI.
the class ExceptionHandlingController method exceptionHandler.
@ExceptionHandler(PermissionDeniedException.class)
public ResponseEntity<JsonResult> exceptionHandler(PermissionDeniedException ex) {
LOGGER.error(ex.getMessage(), ex);
JsonResult result = new JsonResult<>(PERMISSION_DENIED);
result.setErrorMessage(ex.getMessage());
return new ResponseEntity<>(result, HttpStatus.OK);
}
use of com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult in project ArachneCentralAPI by OHDSI.
the class ExceptionHandlingController method exceptionHandler.
@ExceptionHandler(IORuntimeException.class)
public ResponseEntity<JsonResult> exceptionHandler(IORuntimeException ex) {
LOGGER.error(ex.getMessage(), ex);
JsonResult result = new JsonResult<>(SYSTEM_ERROR);
result.setErrorMessage(ex.getMessage());
return new ResponseEntity<>(result, HttpStatus.OK);
}
use of com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult in project ArachneCentralAPI by OHDSI.
the class ExceptionHandlingController method exceptionHandler.
@ExceptionHandler(AccessDeniedException.class)
public ResponseEntity<JsonResult> exceptionHandler(AccessDeniedException ex) {
LOGGER.error(ex.getMessage());
JsonResult result = new JsonResult<>(PERMISSION_DENIED);
result.setErrorMessage(ex.getMessage());
return new ResponseEntity<>(result, HttpStatus.OK);
}
use of com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult in project ArachneCentralAPI by OHDSI.
the class ExceptionHandlingController method exceptionHandler.
@ExceptionHandler(NotEmptyException.class)
public ResponseEntity<JsonResult> exceptionHandler(NotEmptyException ex) {
LOGGER.error(ex.getMessage(), ex);
JsonResult result = new JsonResult<>(DEPENDENCY_EXISTS);
result.setErrorMessage(ex.getMessage());
return new ResponseEntity<>(result, HttpStatus.OK);
}
Aggregations