Permalink
Browse files

bug 733831: Report when the kumascript service request times out or r…

…esponds with some other error status
  • Loading branch information...
1 parent 131af9d commit 51a225b9092289c1d4453ba15339f08887feabe1 @lmorchard lmorchard committed Mar 19, 2012
Showing with 18 additions and 2 deletions.
  1. +17 −1 apps/wiki/views.py
  2. +1 −1 kumascript
View
18 apps/wiki/views.py
@@ -386,7 +386,7 @@ def _perform_kumascript_request(request, response_headers, document_locale,
resp_errors = [
{ "level": "error",
"message": "Problem parsing errors: %s" % e,
- "args": [ "ErrorParsingError" ] }
+ "args": [ "ParsingError" ] }
]
# Set a header so we can see what happened in caching.
@@ -412,7 +412,23 @@ def _perform_kumascript_request(request, response_headers, document_locale,
response_headers['X-Kumascript-Caching'] = (
'304 Not Modified, Age: %s' % resp.headers.get('age', 0))
+ elif resp.status_code == None:
+ resp_errors = [
+ { "level": "error",
+ "message": "Request to Kumascript service timed out",
+ "args": [ "TimeoutError" ] }
+ ]
+
+ else:
+ resp_errors = [
+ { "level": "error",
+ "message": "Unexpected response from Kumascript service: %s" % resp.status_code,
+ "args": [ "UnknownError" ] }
+ ]
+
+
except Exception, e:
+ raise
# Do nothing, if the kumascript service fails in some way.
# TODO: Log the failure more usefully here.
logging.debug("KS FAILED %s" % e)
2 kumascript
@@ -1 +1 @@
-Subproject commit 8ab9ff0b4455149ea50b211a7cfef73ccab5301a
+Subproject commit 92d01a677683bfe6f5f94537fb5a96abb0930270

0 comments on commit 51a225b

Please sign in to comment.