asp.net web api - How to add the unhandled exceptions accross the applications in response body in WEB API -
How to add unrelated exceptions to applications in the body with feedback in the WEB API, if there is no exception, Success must be sent to the body .... It is necessary to get help in getting it.
You need two things to clear exceptions, you have included an AdWords Enterprise Policy You need to set up,
You can configure the error policy preferences in the IncludeErrorDetailPolicy property as part of the Configuration Object (HTTP configuration). This is just an ANIM, which gives instructions to Web ADI about how to deal with the exceptions.
The potential value of this enum is,
Default: This uses the configurations configuration if you use ASP.NET as a host or locale for self-host Are there. LocalOnly: Includes error details for local requests only Always: Always include error details Never: Error details are not included
When an exception occurs, the value of this setting in the Web API Regarding the exception of the response message or not, for example, if enabled, the web API will serialize the exception details as part of the message that you Ratikriya get in.
Success messages do not matter so because you already have a response status code. A status code is equal to that means that everything is fine. If you still want to add an additional message, use HttpMessageHandler which checks the response status code. If the status code is correct, add a message. However, the reaction body has already been determined at that point so that you can not modify it. You can add a message as a header.
Comments
Post a Comment