aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage/http.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2012-08-29 16:24:03 -0400
committerW. Trevor King <wking@tremily.us>2012-08-29 23:29:56 -0400
commit5a32d82284e54facf2f5dcb03ba37afe3805a609 (patch)
tree3252239fcf095bfdf89708fce55cd359b7d9ca52 /libbe/storage/http.py
parent2950a115fb106ae73b87f87dc4865156d9311f8e (diff)
downloadbugseverywhere-5a32d82284e54facf2f5dcb03ba37afe3805a609.tar.gz
util:wsgi: add BEExceptionApp for translating storage exceptions.
This fixes .test_get_initial_value for the HTTP backend, because the tests use TestingHTTP.getURL, which only catch HandlerError, not the more specific storage exceptions.
Diffstat (limited to 'libbe/storage/http.py')
-rw-r--r--libbe/storage/http.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbe/storage/http.py b/libbe/storage/http.py
index 511e63f..5fe0dfc 100644
--- a/libbe/storage/http.py
+++ b/libbe/storage/http.py
@@ -46,6 +46,7 @@ if TESTING == True:
import libbe.bugdir
import libbe.command.serve
import libbe.util.http
+ import libbe.util.wsgi
class HTTP (base.VersionedStorage):
@@ -264,8 +265,9 @@ if TESTING == True:
name = 'TestingHTTP'
def __init__(self, repo, *args, **kwargs):
self._storage_backend = base.VersionedStorage(repo)
- self.app = libbe.command.serve.ServerApp(
+ app = libbe.command.serve.ServerApp(
storage=self._storage_backend)
+ self.app = libbe.util.wsgi.BEExceptionApp(app=app)
HTTP.__init__(self, repo='http://localhost:8000/', *args, **kwargs)
self.intitialized = False
# duplicated from libbe.command.serve.WSGITestCase