code: @Override
      public Response toResponse(Throwable exception) {
          int status = parseHttpStatus(exception);
  
          ErrorMessage message = new ErrorMessage();
  
          if (exception instanceof MappableException
                  && exception.getCause() != null) {
              exception = exception.getCause();
          }
  
          message.setCode(Hashing.murmur3_32().hashUnencodedChars(exception.getClass().getName()).toString());
          message.setStatus(status);
          message.setThrowable(exception);
          message.setMessage(parseMessage(exception, status));
          message.setDescription(parseDescription(exception, status));
          message.setErrors(parseErrors(exception, status));
  
          MediaType type = ExceptionMapperUtils.getResponseType(status);
          if (status == 500) {
              String uri = "";
              if (Requests.getRequest() != null) {
                  uri = " > " + Requests.getUriInfo().getRequestUri();
              }
              logger.error(message.getMessage() + uri, exception);
          } else if (status == 404) {
              Requests.setProperty(BEFORE_EXCEPTION_KEY, exception);
          }
  
          return Response.status(status)
                  .type(type)
                  .entity(message).build();
      }
docs: {@inheritDoc}