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
a error message is printed. This error message could be used to show some diagnostics to the user. The error message is assembled via this function in request.js
xhr.onload=functiononload(){// allow success when 2xx status// see https://github.com/react-component/upload/issues/34if(xhr.status<200||xhr.status>=300){returnoption.onError(getError(option,xhr),getBody(xhr));}returnoption.onSuccess(getBody(xhr),xhr);};
This is all well and correct.
Now in the Network tab of DevTools right click on the previous upload.do request and Block it from the menu (to simulate a network failure).
Upload a file - will be marked as Blocked in the Network tab.
console.log(err) in onError now outputs a different error object without a message. This is totally different from the previous err parameter and not usable for printing to the user anymore
Looking at the stacktrace this code now comes from
xhr.onerror=functionerror(e){option.onError(e);};
also in request.js just above xhr.onload
Expected results
Network failures should also pass the same err object to the onError prop as there would be a server message failure, so that it is easier to show such errors to the user.
The text was updated successfully, but these errors were encountered:
Steps to reproduce
a error message is printed. This error message could be used to show some diagnostics to the user. The error message is assembled via this function in
request.js
This is all well and correct.
upload.do
request andBlock
it from the menu (to simulate a network failure).Blocked
in the Network tab.err
parameter and not usable for printing to the user anymoreLooking at the stacktrace this code now comes from
also in
request.js
just abovexhr.onload
Expected results
Network failures should also pass the same
err
object to theonError
prop as there would be a server message failure, so that it is easier to show such errors to the user.The text was updated successfully, but these errors were encountered: