aboutsummaryrefslogtreecommitdiffstats
path: root/pysite
diff options
context:
space:
mode:
authorGravatar Joseph <[email protected]>2018-05-08 22:16:08 +0100
committerGravatar Joseph <[email protected]>2018-05-08 22:16:08 +0100
commitf3ac4cfbeb0db171bf55440c7f0d2dce8d8d6e8f (patch)
treefdf4b843a69ff963c742a1bce028980474cb1e00 /pysite
parentaccount for the FLASK_DEBUG env not being there before running tests (diff)
Switch from using abort to using werkzeug exception
Diffstat (limited to 'pysite')
-rw-r--r--pysite/database.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pysite/database.py b/pysite/database.py
index 41fbd253..b9ed5b89 100644
--- a/pysite/database.py
+++ b/pysite/database.py
@@ -7,9 +7,9 @@ from typing import Any, Callable, Dict, Iterator, List, Optional, Union
import re
import rethinkdb
-from flask import abort
from rethinkdb.ast import RqlMethodQuery, Table, UserError
from rethinkdb.net import DefaultConnection
+from werkzeug.exceptions import ServiceUnavailable
from pysite.constants import DEBUG_MODE
@@ -144,7 +144,7 @@ class RethinkDB:
try:
self.conn = self.get_connection()
except rethinkdb.RqlDriverError:
- abort(503, "Database connection could not be established.")
+ raise ServiceUnavailable("Database connection could not be established.")
def teardown_request(self, _):
"""