diff --git a/sanic_cors/extension.py b/sanic_cors/extension.py index f87f546..d537ced 100644 --- a/sanic_cors/extension.py +++ b/sanic_cors/extension.py @@ -387,7 +387,8 @@ def wrapper(cls, f, ctx, req, e): else: do_await = iscoroutinefunction(f) resp = f(req, e) - if do_await: + # async Exceptions may be awaitable and should be returned + if isawaitable(resp) or do_await: log(logging.DEBUG, "Found an async Exception handler response. " "Cannot apply CORS to it. Passing it on.")