aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/base_route.py
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2018-03-06 20:05:44 +0100
committerGravatar Jeremiah Boby <[email protected]>2018-03-06 19:05:44 +0000
commit5d685b27c5454e29809fe6039e0cf8945cbbb52f (patch)
tree2782bd8144f744bfc46924f64fb57f465cf31d67 /pysite/base_route.py
parentFix user API test (diff)
API for tags (#34)
* Help page and misc improvements Committing so I can go home >:| * [WIP] - API improvements for the tag features. Not completed. * renaming tag.py to tags.py and refactoring the nomenclature of docs to tags * fixed error message in tags, cleaning up app_test.py * tests for the tags feature * ignoring jsonify returns cause coverall can't handle them * Catch-all error view for the API blueprint * cleaning up APIErrorView a little * bringing coverage for tags.py to 100% * how did this get in here? * how did this get in here? ROUND 2 * Removing the 503 database error handling. It's not in use and we should probably rethink that whole custom error handling system anyway. * Converting the tags file to use the @api_params decorator instead of validating manually. Tested with bot staging.
Diffstat (limited to 'pysite/base_route.py')
-rw-r--r--pysite/base_route.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pysite/base_route.py b/pysite/base_route.py
index f389b56e..4e1a63a7 100644
--- a/pysite/base_route.py
+++ b/pysite/base_route.py
@@ -86,11 +86,12 @@ class APIView(RouteView):
... return self.error(ErrorCodes.unknown_route)
"""
- def error(self, error_code: ErrorCodes) -> Response:
+ def error(self, error_code: ErrorCodes, error_info: str = "") -> Response:
"""
Generate a JSON response for you to return from your handler, for a specific type of API error
:param error_code: The type of error to generate a response for - see `constants.ErrorCodes` for more
+ :param error_info: An optional message with more information about the error.
:return: A Flask Response object that you can return from your handler
"""