You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an interaction fails, the bakery only prints the HTTP status code, not the actual returned error.
For example:
Traceback (most recent call last):
File "/snap/canonical-rbac/18/bin/crbs-admin", line 11, in <module>
load_entry_point('crbs==1.0.0', 'console_scripts', 'crbs-admin')()
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/crbs/cmd/_script.py", line 60, in __call__
return self._actions[options.action](options)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/crbs/cmd/_script.py", line 18, in __call__
self.execute(options)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/crbs/cmd/admin/_create_candid_agent.py", line 49, in execute
parent=True)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/crbs/candid.py", line 146, in create_user
response = self._request('POST', 'v1/u', json=content)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/crbs/candid.py", line 162, in _request
resp = self._client.request(method, f'{self.url}/{path}', json=json)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/macaroonbakery/httpbakery/_client.py", line 87, in request
return requests.request(method=method, url=url, **kwargs)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/requests/sessions.py", line 653, in send
r = dispatch_hook('response', hooks, r, **kwargs)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/requests/hooks.py", line 31, in dispatch_hook
_hook_data = hook(hook_data, **kwargs)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/macaroonbakery/httpbakery/_client.py", line 292, in hook
client.handle_error(error, req.url)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/macaroonbakery/httpbakery/_client.py", line 104, in handle_error
self.key,
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/macaroonbakery/bakery/_discharge.py", line 77, in discharge_all
dm = get_discharge(cav.cav, cav.encrypted_caveat)
File "/snap/canonical-rbac/18/lib/python3.6/site-packages/macaroonbakery/httpbakery/_client.py", line 156, in acquire_discharge
'discharge failed with code {}'.format(resp.status_code))
macaroonbakery.httpbakery._error.DischargeError: third party refused dischargex: discharge failed with code 500
The code should treat the error response from a discharge endpoint as a regular error and print the message contained in it.
The text was updated successfully, but these errors were encountered:
When an interaction fails, the bakery only prints the HTTP status code, not the actual returned error.
For example:
The code should treat the error response from a discharge endpoint as a regular error and print the message contained in it.
The text was updated successfully, but these errors were encountered: