code: static <T> Middleware<SyncHandler<Response<T>>, SyncHandler<Response<T>>> exceptionMiddleware() {
      return handler -> requestContext -> {
        try {
          return handler.invoke(requestContext);
        } catch (RuntimeException e) {
          return Response.forStatus(Status.IM_A_TEAPOT);
        }
      };
    }
docs: A generic middleware that maps uncaught exceptions to error code 418