public ResourceParseException(Errors errors) { super(errors.toString()); this.errors = errors; }
/** * Output an error object. * * @param status HTTP status * @param title fixed error description * @param detail human-readable error description * * @throws IOException if unable to output the error */ private void sendError(final int status, @Nonnull @NotEmpty final String title, @Nonnull @NotEmpty final String detail) throws IOException { final HttpServletResponse response = getHttpServletResponse(); response.setContentType("application/json"); response.setHeader("Cache-Control", "must-revalidate,no-cache,no-store"); response.setStatus(status); final Error e = new Error(); final Errors errors = new Errors(); errors.setErrors(Collections.singletonList(e)); e.setStatus(Integer.toString(status)); e.setTitle(title); e.setDetail(detail); objectMapper.writer().withDefaultPrettyPrinter().writeValue(response.getOutputStream(), errors); }
/** * Output an error object. * * @param status HTTP status * @param title fixed error description * @param detail human-readable error description * * @throws IOException if unable to output the error */ private void sendError(final int status, @Nonnull @NotEmpty final String title, @Nonnull @NotEmpty final String detail) throws IOException { final HttpServletResponse response = getHttpServletResponse(); response.setContentType("application/json"); response.setHeader("Cache-Control", "must-revalidate,no-cache,no-store"); response.setStatus(status); final Error e = new Error(); final Errors errors = new Errors(); errors.setErrors(Collections.singletonList(e)); e.setStatus(Integer.toString(status)); e.setTitle(title); e.setDetail(detail); objectMapper.writer().withDefaultPrettyPrinter().writeValue(response.getOutputStream(), errors); }
public ResourceParseException(Errors errors) { super(errors.toString()); this.errors = errors; }