Commit Graph

7 Commits

Author SHA1 Message Date
Leo Hemsted
cd9b80f415 set test_errors app fixture to session scope
we have one global metrics variable `metrics = GDSMetrics()`, and we
then call `metrics.init_app` from within the flask application set up.
The v2/test_errors.py app_for_test fixture calls create_app, would call
metrics.init_app multiple times for the same metrics instance. This
causes errors, so change the fixture to session level so it only calls
once per test run.
2020-06-12 14:52:22 +01:00
Leo Hemsted
2c2eb2abad handle 405s
Handle werkzeug http errors separately. Also, improve the generic
`Exception` handler to be more flexible when exceptions don't look
like http errors.

note: because they're 405s the route isn't matched, so the v2 error
handlers don't trip properly. this might be an issue because the
internal endpoints expect a different return format. Might have to
think about how to handle this.
2019-07-26 13:26:20 +01:00
Ken Tsang
92508d3b96 Create JobIncompleteError 2017-10-11 15:50:20 +01:00
Rebecca Law
a186fc95be Added new endpoints to return the yearly-usage and monthly-usage for a given financial year and service id.
Since the response has changed I have created new endpoints so that the deployments for Admin are more managable.

Removed print statements from some tests.
2017-04-28 10:10:48 +01:00
Rebecca Law
c758694b98 Change validation error message to a string from a dict. 2016-11-10 16:30:51 +00:00
Rebecca Law
7d763260ce Update format of the errors for DataError and exception 2016-11-10 14:53:39 +00:00
Rebecca Law
346d90e319 update V2 error response to
{status_code: 403,
 errors: [error: AuthError, message: token has expired}]
}
2016-11-09 14:56:54 +00:00