drdk / ffmpeg-farm

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Clean up controller by just throwing exceptions and rely on the exception filter. #6

Open bobend opened 8 years ago

bobend commented 8 years ago

eg. change

throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Machinename must be specified"));

to

throw new ArgumentNullException("Machinename must be specified",nameof(machineName));
bobend commented 8 years ago

This will also make the unittests more readable.

mchadrdk commented 8 years ago

Initial cleanup in 73041561e45c40e4737b4728d440a2d2b7db47f0

Changing the rest of the HttpResponseExceptions would take away the friendly error message from ModelState validation