use of org.nzbhydra.ExceptionInfo in project nzbhydra2 by theotherp.
the class NewsWeb method handleNewsException.
@ExceptionHandler(value = { IOException.class })
protected ResponseEntity<ExceptionInfo> handleNewsException(IOException ex, WebRequest request) {
String error = "An error occurred while getting news: " + ex.getMessage();
logger.error(error);
return new ResponseEntity<>(new ExceptionInfo(500, error, ex.getClass().getName(), error, request.getContextPath()), HttpStatus.valueOf(500));
}
use of org.nzbhydra.ExceptionInfo in project nzbhydra2 by theotherp.
the class UpdatesWeb method handleUpdateException.
@ExceptionHandler(value = { UpdateException.class })
protected ResponseEntity<ExceptionInfo> handleUpdateException(UpdateException ex) {
String error = "An error occurred while updating or getting update infos: " + ex.getMessage();
logger.error(error);
return new ResponseEntity<>(new ExceptionInfo(500, error, ex.getClass().getName(), error, SessionStorage.requestUrl.get()), HttpStatus.valueOf(500));
}
Aggregations