def raise_error(self, exc, identity=None):
if isinstance(exc, ApiUnauthorized):
six.reraise(
InvalidIdentity,
InvalidIdentity(self.message_from_error(exc), identity=identity),
sys.exc_info()[2]
)
elif isinstance(exc, ApiError):
six.reraise(
PluginError,
PluginError(self.message_from_error(exc)),
sys.exc_info()[2]
)
elif isinstance(exc, PluginError):
raise
else:
self.logger.exception(six.text_type(exc))
six.reraise(
PluginError,
PluginError(self.message_from_error(exc)),
sys.exc_info()[2]
)
评论列表
文章目录