using System.Threading.Tasks;
namespace EmbedIO
{
///
/// A callback used to build the contents of the response for an .
///
/// An interface representing the context of the request.
/// An interface.
/// A representing the ongoing operation.
///
/// When this delegate is called, the response's status code has already been set and the
/// method has already been called. The only thing left to do is preparing the response's content, according
/// to the property.
/// Any exception thrown by a handler (even a HTTP exception) will go unhandled: the web server
/// will not crash, but processing of the request will be aborted, and the response will be flushed as-is.
/// In other words, it is not a good ides to throw HttpException.NotFound() (or similar)
/// from a handler.
///
public delegate Task HttpExceptionHandlerCallback(IHttpContext context, IHttpException httpException);
}