Skip to content

Solid.Http.Extensions.ExceptionMapper Extending

HX-Rd edited this page May 30, 2018 · 4 revisions

Extending

There are two mappers set by default by the extension, SolidHttpDefaultExceptionMapper and SolidHttpModelExceptionMapper, and they map the exceptions SolidHttpRequestException and SolidHttpRequestModelException. In this section we will create a new mapper that will map the exception CustomException

Now lets say that we are calling an API that returns some custom body on exceptions. In our example lets say the exception contract is like so

{
    "cust1": "SomeVal1",
    "cust2": "SomeVal2",
    "cust3": "SomeVal3"
}

Clone this wiki locally