upload raises exception if Content-Type is not multipart/form-data
cemerick opened this issue · 0 comments
This check is done in a couple of places:
Lines 102 to 115 in 2386083
The problem is that the exception that is raised is an undifferentiated Failure
. This is mostly okay when handling requests from live users (as they'll just see whatever error page produced by your installed error handler/template), but is much less useful in an API context, where one would much rather produce a 400 bad request response, rather than and (erroneous) 500 internal server error.
ISTM that the upload functions that raise this failure should either return a result carrying a potential array of informative error types, or a distinct exception type be raised so that callers can issue an appropriate response.