Class ExceptionHandler
- Namespace
- JsonApiDotNetCore.Middleware
- Assembly
- JsonApiDotNetCore.dll
Central place to handle all exceptions, such as log them and translate into error response.
[PublicAPI]
public class ExceptionHandler : IExceptionHandler
- Inheritance
-
ExceptionHandler
- Implements
- Inherited Members
Constructors
ExceptionHandler(ILoggerFactory, IJsonApiOptions)
public ExceptionHandler(ILoggerFactory loggerFactory, IJsonApiOptions options)
Parameters
loggerFactory
ILoggerFactoryoptions
IJsonApiOptions
Methods
CreateErrorResponse(Exception)
protected virtual IReadOnlyList<ErrorObject> CreateErrorResponse(Exception exception)
Parameters
exception
Exception
Returns
GetLogLevel(Exception)
protected virtual LogLevel GetLogLevel(Exception exception)
Parameters
exception
Exception
Returns
GetLogMessage(Exception)
protected virtual string GetLogMessage(Exception exception)
Parameters
exception
Exception
Returns
HandleException(Exception)
public IReadOnlyList<ErrorObject> HandleException(Exception exception)
Parameters
exception
Exception