A drive by review of the Uber API
Uber recently announced the availability of a public API. I decided to take it for a spin and provide some commentary. The quick version is that it is a fairly standard HTTP API and that is both a good thing and a bad thing.
Centralized exception handling using a ASP.NET Web API MessageHandler
ASP.NET Web API 2.1 introduced some significant improvements to the mechanisms that support global error handling. Before this release there were a number of different types of errors that would be handled directly by the runtime and there was no easy way to intercept these errors and add your own custom behavior. The standard guidance suggests you register these new handlers as services, but I prefer a different approach that seems more natural to me.
These 8 lines of code can make debugging your ASP.Net Web API a little bit easier.
I think most us ASP.Net Web API developers have, at some point, experienced the problem where their API is returning a 500 Internal Server Error, but tracing through with Visual Studio doesn't reveal any exceptions in our code. This problem is often caused when a MediaTypeFormatter is unable to serialize an object. This simple message handler can take away some of the pain of debugging these scenarios.