Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 26, 2013 03:08 PM by BrockAllen
Member
2 Points
5 Posts
Jan 26, 2013 04:32 AM|LINK
Hi,
While developing WCF services , we will use fault exceptions to throw exceptions to the client as a practice. What is the best practice to throw exceptions in WEB API ? What is the best way to handle WEB API exceptions at client side.
142 Points
24 Posts
Jan 26, 2013 05:08 AM|LINK
In Web API, the errors & exceptions are handled through HTTP response codes. Please refer to this detailed article about error handling in Web API
http://www.asp.net/web-api/overview/web-api-routing-and-actions/exception-handling
All-Star
27432 Points
4890 Posts
MVP
Jan 26, 2013 03:08 PM|LINK
Also, while not exhaustive, this might be a helpgul guid for the type of status codes you need to think about in your various action methods.
http://brockallen.com/2012/05/14/http-status-codes-for-rest/
infytest
Member
2 Points
5 Posts
Throw web API exceptions to the client
Jan 26, 2013 04:32 AM|LINK
Hi,
While developing WCF services , we will use fault exceptions to throw exceptions to the client as a practice. What is the best practice to throw exceptions in WEB API ? What is the best way to handle WEB API exceptions at client side.
innological
Member
142 Points
24 Posts
Re: Throw web API exceptions to the client
Jan 26, 2013 05:08 AM|LINK
In Web API, the errors & exceptions are handled through HTTP response codes. Please refer to this detailed article about error handling in Web API
http://www.asp.net/web-api/overview/web-api-routing-and-actions/exception-handling
DotCastle Team
http://www.dotcastle.com
Note: Please mark this post as ANSWER if it addresses your question/issue
BrockAllen
All-Star
27432 Points
4890 Posts
MVP
Re: Throw web API exceptions to the client
Jan 26, 2013 03:08 PM|LINK
Also, while not exhaustive, this might be a helpgul guid for the type of status codes you need to think about in your various action methods.
http://brockallen.com/2012/05/14/http-status-codes-for-rest/
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/