/** * Generates a 500 INTERNAL_SERVER_ERROR chunked result. */ public static Status internalServerError(InputStream content) { return internalServerError(content, defaultChunkSize); }
/** * Generates a 500 Internal Server Error result. * * @param content The file to send. * @return the result */ public static Result internalServerError(File content) { return internalServerError(content, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 500 Internal Server Error result. * * @param content The file to send. * @param filename The name to send the file as. * @return the result */ public static Result internalServerError(File content, String filename) { return internalServerError(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 500 Internal Server Error result. * * @param content The file to send. * @param inline Whether the file should be sent inline, or as an attachment. * @return the result */ public static Result internalServerError(File content, boolean inline) { return internalServerError(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 500 Internal Server Error result. * * @param content The file to send. * @return the result */ public static Result internalServerError(File content) { return internalServerError(content, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 500 Internal Server Error result. * * @param content The file to send. * @return the result */ public static Result internalServerError(File content) { return internalServerError(content, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 500 Internal Server Error result. * * @param content The file to send. * @param filename The name to send the file as. * @return the result */ public static Result internalServerError(File content, String filename) { return internalServerError(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 500 Internal Server Error result. * * @param content The file to send. * @param filename The name to send the file as. * @return the result */ public static Result internalServerError(File content, String filename) { return internalServerError(content, filename, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 500 Internal Server Error result. * * @param content The file to send. * @param inline Whether the file should be sent inline, or as an attachment. * @return the result */ public static Result internalServerError(File content, boolean inline) { return internalServerError(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
/** * Generates a 500 Internal Server Error result. * * @param content The file to send. * @param inline Whether the file should be sent inline, or as an attachment. * @return the result */ public static Result internalServerError(File content, boolean inline) { return internalServerError(content, inline, StaticFileMimeTypes.fileMimeTypes()); }
/** * Invoked in dev mode when a server error occurs. Note that this method is where the URL set by play.editor is used. * <p> * The base implementation returns {@code Results.internalServerError} with the content of {@code views.html.defaultpages.devError}. * * @param request The request that triggered the error. * @param exception The exception. * @return a CompletionStage containing the Result. */ protected CompletionStage<Result> onDevServerError(RequestHeader request, UsefulException exception) { return CompletableFuture.completedFuture(Results.internalServerError(views.html.defaultpages.devError.render(playEditor, exception, request.asScala()))); }
/** * Invoked in dev mode when a server error occurs. Note that this method is where the URL set by play.editor is used. * <p> * The base implementation returns {@code Results.internalServerError} with the content of {@code views.html.defaultpages.devError}. * * @param request The request that triggered the error. * @param exception The exception. * @return a CompletionStage containing the Result. */ protected CompletionStage<Result> onDevServerError(RequestHeader request, UsefulException exception) { return CompletableFuture.completedFuture(Results.internalServerError(views.html.defaultpages.devError.render(playEditor, exception, request.asScala()))); }
/** * Invoked in dev mode when a server error occurs. Note that this method is where the URL set by play.editor is used. * <p> * The base implementation returns {@code Results.internalServerError} with the content of {@code views.html.defaultpages.devError}. * * @param request The request that triggered the error. * @param exception The exception. * @return a CompletionStage containing the Result. */ protected CompletionStage<Result> onDevServerError(RequestHeader request, UsefulException exception) { return CompletableFuture.completedFuture(Results.internalServerError(views.html.defaultpages.devError.render(playEditor, exception, request.asScala()))); }
@Override public CompletionStage<Result> onServerError(RequestHeader request, Throwable exception) { try { UsefulException usefulException = throwableToUsefulException(exception); logServerError(request, usefulException); switch (environment.mode()) { case PROD: return CompletableFuture.completedFuture(Results.internalServerError(prodServerError(request, usefulException))); default: return CompletableFuture.completedFuture(Results.internalServerError(devServerError(request, usefulException))); } } catch (Exception e) { logger.error("Error while handling error", e); return CompletableFuture.completedFuture(Results.internalServerError()); } }
@Override public CompletionStage<Result> onServerError(RequestHeader request, Throwable exception) { try { UsefulException usefulException = throwableToUsefulException(exception); logServerError(request, usefulException); switch (environment.mode()) { case PROD: return CompletableFuture.completedFuture(Results.internalServerError(prodServerError(request, usefulException))); default: return CompletableFuture.completedFuture(Results.internalServerError(devServerError(request, usefulException))); } } catch (Exception e) { logger.error("Error while handling error", e); return CompletableFuture.completedFuture(Results.internalServerError()); } }
/** * Invoked in prod mode when a server error occurs. * <p> * The base implementation returns {@code Results.internalServerError} with the content of {@code views.html.defaultpages.error} template. * </p> * <p> * Override this rather than [[onServerError()]] if you don't want to change Play's debug output when logging errors * in dev mode. * * @param request The request that triggered the error. * @param exception The exception. * @return a CompletionStage containing the Result. */ protected CompletionStage<Result> onProdServerError(RequestHeader request, UsefulException exception) { return CompletableFuture.completedFuture(Results.internalServerError(views.html.defaultpages.error.render(exception, request.asScala()))); }
/** * Invoked in prod mode when a server error occurs. * * Override this rather than [[onServerError()]] if you don't want to change Play's debug output when logging errors * in dev mode. * * @param request The request that triggered the error. * @param exception The exception. */ protected F.Promise<Result> onProdServerError(RequestHeader request, UsefulException exception) { return F.Promise.<Result>pure(Results.internalServerError(views.html.defaultpages.error.render(exception))); }
/** * Invoked in dev mode when a server error occurs. * * @param request The request that triggered the error. * @param exception The exception. */ protected F.Promise<Result> onDevServerError(RequestHeader request, UsefulException exception) { return F.Promise.<Result>pure(Results.internalServerError(views.html.defaultpages.devError.render(playEditor, exception))); }
/** * Invoked in prod mode when a server error occurs. * <p> * The base implementation returns {@code Results.internalServerError} with the content of {@code views.html.defaultpages.error} template. * </p> * <p> * Override this rather than [[onServerError()]] if you don't want to change Play's debug output when logging errors * in dev mode. * * @param request The request that triggered the error. * @param exception The exception. * @return a CompletionStage containing the Result. */ protected CompletionStage<Result> onProdServerError(RequestHeader request, UsefulException exception) { return CompletableFuture.completedFuture(Results.internalServerError(views.html.defaultpages.error.render(exception, request.asScala()))); }
/** * Invoked in prod mode when a server error occurs. * <p> * The base implementation returns {@code Results.internalServerError} with the content of {@code views.html.defaultpages.error} template. * </p> * <p> * Override this rather than [[onServerError()]] if you don't want to change Play's debug output when logging errors * in dev mode. * * @param request The request that triggered the error. * @param exception The exception. * @return a CompletionStage containing the Result. */ protected CompletionStage<Result> onProdServerError(RequestHeader request, UsefulException exception) { return CompletableFuture.completedFuture(Results.internalServerError(views.html.defaultpages.error.render(exception, request.asScala()))); }