io.javalin.http.ExceptionHandler Maven / Gradle / Ivy
/*
* Javalin - https://javalin.io
* Copyright 2017 David Åse
* Licensed under Apache 2.0: https://github.com/tipsy/javalin/blob/master/LICENSE
*/
package io.javalin.http;
import io.javalin.Javalin;
import org.jetbrains.annotations.NotNull;
/**
* A handler for use with {@link Javalin#exception(Class, ExceptionHandler)}.
* Is triggered when exceptions are thrown by a {@link Handler}.
*
* @see Context
* @see Exception mapping in docs
*/
@FunctionalInterface
public interface ExceptionHandler {
void handle(@NotNull T exception, @NotNull Context ctx);
}