-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: GRPCException should inherit from APIException #235
Conversation
|
||
def log_exception(self, exception: Exception, message: str, extra={}): | ||
logging_level = "ERROR" | ||
if isinstance(exception, GRPCException): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be issubclass if someone want to override our class to change loggign level no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceptions are always instanciated
status_code, details = self._get_status_code_and_details(exc) | ||
await context.abort(status_code, details) | ||
|
||
def log_exception(self, exception: Exception, message: str, extra={}): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this need doc string and may not have it's place in servicer proxy. Maybe a method in exception.py too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is closely tied with the class and can be easily overriden
No description provided.