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:
@@ -188,7 +188,7 @@ class Handler:
|
||||
|
||||
def default(self, request, exception):
|
||||
log.error(format_exc())
|
||||
if issubclass(type(exception), SanicException):
|
||||
if isinstance(exception, SanicException):
|
||||
return text(
|
||||
'Error: {}'.format(exception),
|
||||
status=getattr(exception, 'status_code', 500))
|
||||
|
||||
Reference in New Issue
Block a user