/** * Returns a status for a given exception or error. By default it returns an * {@link Status#SERVER_ERROR_INTERNAL} status and logs a severe message.<br> * In order to customize the default behavior, this method can be * overridden. * * @param throwable * The exception or error caught. * @param resource * The parent resource. * @return The representation of the given status. */ public Status toStatus(Throwable throwable, Resource resource) { return getStatus(throwable, resource); } }
/** * Returns a status for a given exception or error. By default it unwraps * the status of {@link ResourceException}. For other exceptions or errors, * it returns an {@link Status#SERVER_ERROR_INTERNAL} status.<br> * <br> * In order to customize the default behavior, this method can be * overridden. * * @param throwable * The exception or error caught. * @param request * The request handled. * @param response * The response updated. * @return The representation of the given status. */ public Status toStatus(Throwable throwable, Request request, Response response) { return getStatus(throwable, request, response); }