# HG changeset patch # User Marcin Kuzminski # Date 2019-10-15 16:51:12 # Node ID 0ef8f167a699d9c458d77bf9a4bcd1e3a39576e1 # Parent 648bee25ec17ac2604aa287256d2cd8a2fa75238 uploads: handle server errors nicer diff --git a/rhodecode/public/js/src/rhodecode/comments.js b/rhodecode/public/js/src/rhodecode/comments.js --- 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 --- 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; } }