C# Class NSwag.AspNetCore.JsonExceptionFilterAttribute

Handles thrown exceptions from action methods and serializes them with the correct HTTP status code.
Inheritance: ActionFilterAttribute
Show file Open project: NSwag/NSwag

Public Methods

Method Description
JsonExceptionFilterAttribute ( ) : System

Initializes a new instance of the JsonExceptionFilterAttribute class.

JsonExceptionFilterAttribute ( bool hideStackTrace ) : System

Initializes a new instance of the JsonExceptionFilterAttribute class.

JsonExceptionFilterAttribute ( bool hideStackTrace, Assembly>.IDictionary searchedNamespaces ) : System

Initializes a new instance of the JsonExceptionFilterAttribute class.

OnActionExecuted ( ActionExecutedContext context ) : void

Occurs after the action method is invoked.

Private Methods

Method Description
GetStatusCode ( Exception exception, ActionExecutedContext context ) : int

Method Details

JsonExceptionFilterAttribute() public method

Initializes a new instance of the JsonExceptionFilterAttribute class.
public JsonExceptionFilterAttribute ( ) : System
return System

JsonExceptionFilterAttribute() public method

Initializes a new instance of the JsonExceptionFilterAttribute class.
public JsonExceptionFilterAttribute ( bool hideStackTrace ) : System
hideStackTrace bool If set to true the serializer hides stack trace (i.e. sets the StackTrace to 'HIDDEN').
return System

JsonExceptionFilterAttribute() public method

Initializes a new instance of the JsonExceptionFilterAttribute class.
public JsonExceptionFilterAttribute ( bool hideStackTrace, Assembly>.IDictionary searchedNamespaces ) : System
hideStackTrace bool If set to true the serializer hides stack trace (i.e. sets the StackTrace to 'HIDDEN').
searchedNamespaces Assembly>.IDictionary The namespaces and assemblies to search for exception types.
return System

OnActionExecuted() public method

Occurs after the action method is invoked.
public OnActionExecuted ( ActionExecutedContext context ) : void
context ActionExecutedContext The action executed context.
return void