Skip to content

Pact Web ErrorHandling Settings ErrorHandlerSettings JsonResponseFormatter

welshronaldo edited this page May 30, 2022 · 3 revisions

ErrorHandlerSettings.JsonResponseFormatter Property

Determines the response body returned for Json responses

public System.Func<Pact.Web.ErrorHandling.Interfaces.IErrorDetails,object> JsonResponseFormatter { get; set; }

Property Value

System.Func<Pact.Web.ErrorHandling.Interfaces.IErrorDetails,System.Object>

Example

JsonResponseFormatter = model => new {result = "ERROR", message = model.Details, code = model.Code};

Clone this wiki locally