In the postRequest() method, you convert any 403 status code into an OutOfScope exception saying that there is a scope issue:
if err.code == 403:
logger.warning("Your current token scope do not allow access to %s" % topic)
raise OutOfScope("Your current token scope do not allow access to %s" % topic) from None
However, this is too simplicistic as you can see in the official API docs: The client also could have run into issues like Maximum usage reached or some other internal issues.
Please do not discard that information when you swallow errors.
In the
postRequest()method, you convert any 403 status code into an OutOfScope exception saying that there is a scope issue:However, this is too simplicistic as you can see in the official API docs: The client also could have run into issues like Maximum usage reached or some other internal issues.
Please do not discard that information when you swallow errors.