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
This is especially problematic, as _v3 is still unreleased, it's hard to catch in a manner that won't break on next b2sdk update.
That case is supposed to be handled by current code, but somehow error translation still fails (tested against current master branch).
../b2-sdk-python/b2sdk/api.py:386: in delete_bucket
self.session.delete_bucket(account_id, bucket.id_)
../b2-sdk-python/b2sdk/session.py:183: in delete_bucket
return self._wrap_default_token(self.raw_api.delete_bucket, account_id, bucket_id)
../b2-sdk-python/b2sdk/session.py:456: in _wrap_default_token
return self._wrap_token(raw_api_method, TokenType.API, *args, **kwargs)
../b2-sdk-python/b2sdk/session.py:462: in _wrap_token
return self._reauthorization_loop(partial_callback)
../b2-sdk-python/b2sdk/session.py:477: in _reauthorization_loop
return callback()
../b2-sdk-python/b2sdk/session.py:467: in _api_token_callback
return raw_api_method(api_url, account_auth_token, *args, **kwargs)
../b2-sdk-python/b2sdk/raw_api.py:530: in delete_bucket
bucketId=bucket_id
../b2-sdk-python/b2sdk/raw_api.py:458: in _post_json
return self.b2_http.post_json_return_json(url, headers, params)
../b2-sdk-python/b2sdk/b2http.py:309: in post_json_return_json
_timeout=timeout,
../b2-sdk-python/b2sdk/b2http.py:262: in post_content_return_json
response = self._translate_and_retry(do_post, try_count, post_params)
../b2-sdk-python/b2sdk/b2http.py:507: in _translate_and_retry
return cls._translate_errors(fcn, post_params)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'b2sdk.v2.b2http.B2Http'>
fcn = <function B2Http.post_content_return_json.<locals>.do_post at 0x7f9cd89ca5f0>
post_params = {'accountId': 'censored', 'bucketId': '2a71a86d67b1d13b83b50e14'}
@classmethod
def _translate_errors(cls, fcn, post_params=None):
"""
Call the given function, turning any exception raised into the right
kind of B2Error.
:param dict post_params: request parameters
"""
response = None
try:
response = fcn()
if response.status_code not in [200, 206]:
# Decode the error object returned by the service
error = json.loads(response.content.decode('utf-8')) if response.content else {}
extra_error_keys = error.keys() - ('code', 'status', 'message')
if extra_error_keys:
logger.debug(
'received error has extra (unsupported) keys: %s', extra_error_keys
)
raise interpret_b2_error(
int(error.get('status', response.status_code)),
error.get('code'),
error.get('message'),
response.headers,
> post_params,
)
E b2sdk.exception.BucketIdNotFound: Bucket with id=2a71a86d67b1d13b83b50e14 not found
../b2-sdk-python/b2sdk/b2http.py:436: BucketIdNotFound
This doesn't quite seem "apiver" legal (more like accidental export to public api), but to catch these I'm using from b2sdk.v2.exception import v3BucketIdNotFound now.
The text was updated successfully, but these errors were encountered:
This is especially problematic, as _v3 is still unreleased, it's hard to catch in a manner that won't break on next b2sdk update.
That case is supposed to be handled by current code, but somehow error translation still fails (tested against current master branch).
This doesn't quite seem "apiver" legal (more like accidental export to public api), but to catch these I'm using
from b2sdk.v2.exception import v3BucketIdNotFound
now.The text was updated successfully, but these errors were encountered: