Class StateExceptionHandler
- Namespace
- FoundationaLLM.State.Exceptions
- Assembly
- FoundationaLLM.State.dll
Implements a global exception handler for the State API.
public class StateExceptionHandler : IExceptionHandler
- Inheritance
-
StateExceptionHandler
- Implements
- Inherited Members
- Extension Methods
Constructors
StateExceptionHandler(ILogger<StateExceptionHandler>)
Implements a global exception handler for the State API.
public StateExceptionHandler(ILogger<StateExceptionHandler> logger)
Parameters
loggerILogger<StateExceptionHandler>The ILogger used for logging.
Methods
TryHandleAsync(HttpContext, Exception, CancellationToken)
Tries to handle the specified exception asynchronously within the ASP.NET Core pipeline. Implementations of this method can provide custom exception-handling logic for different scenarios.
public ValueTask<bool> TryHandleAsync(HttpContext httpContext, Exception exception, CancellationToken cancellationToken)
Parameters
httpContextHttpContextThe HttpContext for the request.
exceptionExceptionThe unhandled exception.
cancellationTokenCancellationTokenThe cancellation token.