InterviewSolution
Saved Bookmarks
| 1. |
How to handle errors in Web API? |
|
Answer» Web API generally provides greater FLEXIBILITY in terms of handling errors. Exception handling is a technique that is used to handle run-time errors in APPLICATION code. One can use HttpResponseException, HttpError, Exception FILTERS, register exception filters, Exception handlers to handle errors. Exception filter can be used to identify unhandled exceptions on actions or controllers, exception handlers can be used to identify any type of unhandled exception application-wide, and HttpResponseException can be used when there is the POSSIBILITY of an exception. |
|