Legoktm has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/399761 )
Change subject: Provide some debugging information when unable to contact hound
......................................................................
Provide some debugging information when unable to contact hound
Bug: T183443
Change-Id: I68181211755215407892631f2c39e6b299d5a989
---
M app.py
1 file changed, 15 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/labs/codesearch
refs/changes/61/399761/1
diff --git a/app.py b/app.py
index 1e595b9..542f238 100644
--- a/app.py
+++ b/app.py
@@ -20,6 +20,7 @@
from flask import Flask, Response, request, redirect, url_for
import requests
+import traceback
app = Flask(__name__)
@@ -93,10 +94,20 @@
if backend not in BACKENDS:
return 'invalid backend'
port = BACKENDS[backend]
- r = requests.get(
- 'http://localhost:%s/%s' % (port, path),
- params=request.args
- )
+ try:
+ r = requests.get(
+ 'http://localhost:%s/%s' % (port, path),
+ params=request.args
+ )
+ except requests.exceptions.ConnectionError as e:
+ resp = """
+Unable to contact hound. Please retry in a few minutes.
+If this error continues, please report it in Phabricator
+with the following information:
+
+"""
+ resp += traceback.format_exc()
+ return Response(resp, 503, mimetype='text/plain')
excluded_headers = ['content-encoding', 'content-length',
'transfer-encoding', 'connection']
headers = [(name, value) for (name, value) in r.raw.headers.items()
if name.lower() not in excluded_headers]
--
To view, visit https://gerrit.wikimedia.org/r/399761
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I68181211755215407892631f2c39e6b299d5a989
Gerrit-PatchSet: 1
Gerrit-Project: labs/codesearch
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits