marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sschaff...@apache.org
Subject [19/50] [abbrv] git commit: change status code of SPARQL timeout to 504 to prevent Firefox from retrying the request immediately (MARMOTTA-280); patched SNORQL so it displays a nicer error message in case the SPARQL query fails
Date Mon, 30 Sep 2013 16:44:56 GMT
change status code of SPARQL timeout to 504 to prevent Firefox from retrying the request immediately
(MARMOTTA-280); patched SNORQL so it displays a nicer error message in case the SPARQL query
fails


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/647cbaed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/647cbaed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/647cbaed

Branch: refs/heads/master
Commit: 647cbaed0f84a76ac031b561c2f6753f266c2cd9
Parents: 49ddd16
Author: Sebastian Schaffert <sschaffert@apache.org>
Authored: Wed Sep 11 17:56:02 2013 +0200
Committer: Sebastian Schaffert <sschaffert@apache.org>
Committed: Wed Sep 11 17:56:02 2013 +0200

----------------------------------------------------------------------
 extras/webjars/snorql/src/main/resources/snorql.js            | 7 ++++++-
 .../platform/sparql/webservices/SparqlWebService.java         | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/647cbaed/extras/webjars/snorql/src/main/resources/snorql.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/snorql.js b/extras/webjars/snorql/src/main/resources/snorql.js
index 620fa1e..b1346de 100755
--- a/extras/webjars/snorql/src/main/resources/snorql.js
+++ b/extras/webjars/snorql/src/main/resources/snorql.js
@@ -289,7 +289,12 @@ function Snorql() {
 
     this.displayErrorMessage = function(message) {
         var pre = document.createElement('pre');
-        pre.innerHTML = message;
+        var json = JSON.parse(message);
+        if(json.message) {
+            pre.innerHTML = '<strong style="color: #ff0000">' + json.message; + "</strong>";
+        } else {
+            pre.innerHTML = message;
+        }
         this._display(pre, 'result');
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/647cbaed/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
index 107db27..a611cf9 100644
--- a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
+++ b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebService.java
@@ -493,7 +493,7 @@ public class SparqlWebService {
                 } catch (MalformedQueryException e) {
                     throw new WebApplicationException(e.getCause(), Response.status(Response.Status.BAD_REQUEST).entity(WebServiceUtil.jsonErrorResponse(e)).build());
                 } catch (TimeoutException e) {
-                    throw new WebApplicationException(e.getCause(), Response.status(Response.Status.REQUEST_TIMEOUT).entity(WebServiceUtil.jsonErrorResponse(e)).build());
+                    throw new WebApplicationException(e.getCause(), Response.status(Response.Status.GATEWAY_TIMEOUT).entity(WebServiceUtil.jsonErrorResponse(e)).build());
                 }
             }
         };


Mime
View raw message