Fixes a raise message of UnboundLocalError: local variable 'msg' referenced before assignment for api responses returning a single error key, such as Error 401: Invalid authentication token where resp and data are:
resp = <Response [401]>
data = {'error': 'Invalid authentication token'}
UnboundLocalError: local variable 'msg' referenced before assignment
for api responses returning a single error key, such asError 401: Invalid authentication token
whereresp
anddata
are: