From 1d1600c5ddd7d8bd5fe0b1b843d8f004267bb622 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sat, 15 Dec 2018 21:02:54 -0400 Subject: [PATCH] Improve the partial navigation error reporting Add a HTTP status code display. If status code is 0 assume there is a communication error and display such. Signed-off-by: Roberto Rosario --- .../static/appearance/js/partial_navigation.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mayan/apps/appearance/static/appearance/js/partial_navigation.js b/mayan/apps/appearance/static/appearance/js/partial_navigation.js index 9b44bf0926..896a99058d 100644 --- a/mayan/apps/appearance/static/appearance/js/partial_navigation.js +++ b/mayan/apps/appearance/static/appearance/js/partial_navigation.js @@ -160,10 +160,19 @@ class PartialNavigation { */ if (djangoDEBUG) { + var errorMessage = null; + + if (jqXHR.status != 0) { + errorMessage = jqXHR.responseText || jqXHR.statusText; + } else { + errorMessage = 'Server communication error.'; + } + $('#ajax-content').html( ' \

Server Error

\ -
' +  jqXHR.responseText || jqXHR.statusText +' \
+                    

Status code: ' + jqXHR.status + '

\ +
' +  errorMessage +' \
                     
\ ' );