From 0a2c47d444e91ac2ff76872d8e511b18662bacbd Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Tue, 15 Oct 2019 18:51:12 +0200 Subject: [PATCH] uploads: handle server errors nicer --- rhodecode/public/js/src/rhodecode/comments.js | 2 +- rhodecode/templates/files/files_upload.mako | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rhodecode/public/js/src/rhodecode/comments.js b/rhodecode/public/js/src/rhodecode/comments.js index ed9ce4b6..a5050522 100644 --- a/rhodecode/public/js/src/rhodecode/comments.js +++ b/rhodecode/public/js/src/rhodecode/comments.js @@ -729,7 +729,7 @@ var CommentsController = function() { if (xhr !== undefined){ var httpStatus = xhr.status + " " + xhr.statusText; - if (xhr.status >= 500) { + if (xhr !== undefined && xhr.status >= 500) { error = httpStatus; } } diff --git a/rhodecode/templates/files/files_upload.mako b/rhodecode/templates/files/files_upload.mako index 502f5749..ac2cca43 100644 --- a/rhodecode/templates/files/files_upload.mako +++ b/rhodecode/templates/files/files_upload.mako @@ -170,7 +170,7 @@ if (xhr !== undefined){ var httpStatus = xhr.status + " " + xhr.statusText; - if (xhr.status >= 500) { + if (xhr !== undefined && xhr.status >= 500) { error = httpStatus; } }