From f1f314f9a59c5d2bd47d86690571fc8af908bba6 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Tue, 4 Jun 2024 11:51:33 -0400 Subject: [PATCH] Improve error message on failed upload --- handlers/static/js/controllers/files.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handlers/static/js/controllers/files.js b/handlers/static/js/controllers/files.js index aab5318f..76ab93cb 100644 --- a/handlers/static/js/controllers/files.js +++ b/handlers/static/js/controllers/files.js @@ -18,6 +18,10 @@ function uploadFormData(url, formData, progressFn) { if (xhr.status >= 200 && xhr.status < 300) { resolve(xhr.response); } else { + if (xhr.responseText) { + reject(xhr.responseText); + return; + } reject(xhr.statusText); } });