use of org.jumpmind.symmetric.web.rest.model.RestError in project symmetric-ds by JumpMind.
the class RestService method handleError.
@ExceptionHandler(Exception.class)
@ResponseBody
public RestError handleError(Exception ex, HttpServletRequest req) {
int httpErrorCode = 500;
Annotation annotation = ex.getClass().getAnnotation(ResponseStatus.class);
if (annotation != null) {
httpErrorCode = ((ResponseStatus) annotation).value().value();
}
return new RestError(ex, httpErrorCode);
}
Aggregations