C# Class NSwag.AspNet.WebApi.JsonExceptionFilterAttribute

Handles thrown exceptions from action methods and serializes them with the correct HTTP status code.
Inheritance: System.Web.Http.Filters.ActionFilterAttribute
Mostra 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 ( System.Web.Http.Filters.HttpActionExecutedContext context ) : void

Occurs after the action method is invoked.

Private Methods

Method Description
GetStatusCode ( Exception exception, System.Web.Http.Filters.HttpActionExecutedContext 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 ( System.Web.Http.Filters.HttpActionExecutedContext context ) : void
context System.Web.Http.Filters.HttpActionExecutedContext The action executed context.
return void