AJAX: Improve error display during debugging
Add message body display when the Django debug flag is True. Add a CSS to simulate the appearence and legibility of the debug message. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -334,3 +334,10 @@ a i {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.pre-server-error {
|
||||
background-color:#ffe7ae;
|
||||
color: black;
|
||||
font-size: 110%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,13 @@ class PartialNavigation {
|
||||
*/
|
||||
|
||||
if (djangoDEBUG) {
|
||||
$('#ajax-content').html('<pre class="text-primary" style="background-color:#ffe7ae"><code>' + jqXHR.statusText + '</code></pre>');
|
||||
$('#ajax-content').html(
|
||||
' \
|
||||
<h4>Server Error</h4> \
|
||||
<pre class="pre-server-error"><code>' + jqXHR.responseText || jqXHR.statusText +'</code> \
|
||||
</pre> \
|
||||
'
|
||||
);
|
||||
} else {
|
||||
if (jqXHR.status == 0) {
|
||||
$('#modal-server-error .modal-body').html($('#template-error').html());
|
||||
|
||||
Reference in New Issue
Block a user