browser: Return a more descriptive error for HTTP 500 (#5112)

master
Harshavardhana 7 years ago committed by Dee Koder
parent 6400f506da
commit b4ddccc2f7
  1. 12
      browser/app/js/actions.js
  2. 56
      browser/ui-assets.go

@ -482,7 +482,7 @@ export const uploadFile = (file, xhr) => {
})) }))
xhr.onload = function(event) { xhr.onload = function(event) {
if (xhr.status == 401 || xhr.status == 403 || xhr.status == 500) { if (xhr.status == 401 || xhr.status == 403) {
setShowAbortModal(false) setShowAbortModal(false)
dispatch(stopUpload({ dispatch(stopUpload({
slug slug
@ -492,6 +492,16 @@ export const uploadFile = (file, xhr) => {
message: 'Unauthorized request.' message: 'Unauthorized request.'
})) }))
} }
if (xhr.status == 500) {
setShowAbortModal(false)
dispatch(stopUpload({
slug
}))
dispatch(showAlert({
type: 'danger',
message: xhr.responseText
}))
}
if (xhr.status == 200) { if (xhr.status == 200) {
setShowAbortModal(false) setShowAbortModal(false)
dispatch(stopUpload({ dispatch(stopUpload({

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save