Improve exception messages
"An error occurred while processing this request."
That message doesn't say anything. A suggestion would be to append the inner exception message. It makes debugging a lot easier.
"One of the request inputs is not valid"
That message doesn't say anything at all and I can't figure out why I get it. It's thrown on SaveChanges()
Ognyan Dimitrov commented
Come On! Do it! You can do it! :)
: 'The remote server returned an error: (500) Internal Server Error.'
This is really a must. Returning only "400 Bad Request" is useless. Obviously the service knows why the request was invalid. Tell us! It can turn into a huge trial-and-error time suck trying to figure out which request rule was violated.
(I've been using Azure for years and it still happens to me! And no, my brain works reasonably well.)
Jonas Gauffin commented
You also report "Entity already exists" on SaveChanges. But since a Savechanges() typically contains more than one added/changed objects it can be hard to find out which object you mean. Can't you include row/partition keys or something?