mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Give a more helpful error when token has expired
We’ve seen quite a few developers encounter the `Invalid token: expired` error message when they’re getting started using the Notify API. When this happens they either raise a support ticket or ask for help on Slack. In every case this has been because the clock on their machine/environment/container isn’t accurate. The error message doesn’t help them figure this out. This commit adds extra detail to the error message so they can fix the problem without having to come to us for help.
This commit is contained in:
@@ -320,7 +320,9 @@ def test_should_return_403_when_token_is_expired(notify_api,
|
||||
headers={'Authorization': 'Bearer {}'.format(token)})
|
||||
assert response.status_code == 403
|
||||
error_message = json.loads(response.get_data())
|
||||
assert error_message['message'] == {'token': ['Invalid token: expired']}
|
||||
assert error_message['message'] == {'token': [
|
||||
'Invalid token: expired, check that your system clock is accurate'
|
||||
]}
|
||||
|
||||
|
||||
def __create_get_token(service_id):
|
||||
|
||||
Reference in New Issue
Block a user