Use `isinstance( instead of issubclass(type(`
When we already have an `instance` it's less typing and faster to use `isinstance`.
This commit is contained in:
@@ -23,7 +23,7 @@ class CustomHandler(Handler):
|
||||
# and can do anything with it (log, send to external service, etc)
|
||||
|
||||
# Some exceptions are trivial and built into Sanic (404s, etc)
|
||||
if not issubclass(type(exception), SanicException):
|
||||
if not isinstance(exception, SanicException):
|
||||
print(exception)
|
||||
|
||||
# Then, we must finish handling the exception by returning
|
||||
|
||||
Reference in New Issue
Block a user