diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-03-10 16:06:59 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-03-10 16:06:59 +0100 |
commit | c6afe44a13b76eea146266f928c0fcbfc3fb358a (patch) | |
tree | 0c01420465eef6c1da61a7e91853ced7a3306f81 /themes | |
parent | f35ff8ac6ee048a8c09e8be7ab0be2c9ad223b4f (diff) | |
download | www-andreasbaumann-cc-c6afe44a13b76eea146266f928c0fcbfc3fb358a.tar.gz www-andreasbaumann-cc-c6afe44a13b76eea146266f928c0fcbfc3fb358a.tar.bz2 |
better error handling in search
Diffstat (limited to 'themes')
-rw-r--r-- | themes/new_theme/layouts/partials/ranklist.html | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/themes/new_theme/layouts/partials/ranklist.html b/themes/new_theme/layouts/partials/ranklist.html index 8bec222..9e37ab4 100644 --- a/themes/new_theme/layouts/partials/ranklist.html +++ b/themes/new_theme/layouts/partials/ranklist.html @@ -199,8 +199,15 @@ timeout: 1000 } ) .error( function( x, t, m ) { - var html = "<pre><font color='red'>" + x.responseText + "</font></pre>\n"; - $( '#query' ).html( html ); + var html = ''; + if( x.status > 0 ) { + msg = x.responseText; + } else { + msg = t; + } + html = "<pre><font color='red'>There was an error communicating to the strusWebService, reason: " + msg + "</font></pre>\n"; + $( '#ranklist' ).html( html ); + $( "#query" ).LoadingOverlay( "hide", true ); } ) .success( function( data ) { @@ -219,7 +226,7 @@ $( "#query" ).LoadingOverlay( "hide" ); } ); }; - + $( window ).load( function( ) { var paramsString = window.location.search; var searchParams = new URLSearchParams( paramsString ); |