You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"The request does not have 'Content-Type: multipart/form_data; ...'"in
log.error (funlog -> log "%s" message);
failwith message
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.
The text was updated successfully, but these errors were encountered:
This check is done in a couple of places:
dream/src/server/upload.ml
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.
The text was updated successfully, but these errors were encountered: