Skip to content

Commit

Permalink
prevent spurious exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Peddle committed Dec 7, 2023
1 parent 9241ee9 commit 90404a2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions potassium/potassium.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ def wrapper(context, request):
# send in app's stateful context if GPU, and the request
out = func(context, request)

if type(out) != Response:
raise Exception("Potassium Response object not returned")

if type(out.body) != bytes and type(out.body) != GeneratorType:
raise Exception(
"Potassium Response object body must be bytes", type(out.body))
if handler_type == HandlerType.HANDLER:
if type(out) != Response:
raise Exception("Potassium Response object not returned")
if type(out.body) != bytes and type(out.body) != GeneratorType:
raise Exception(
"Potassium Response object body must be bytes", type(out.body))

return out

Expand Down

0 comments on commit 90404a2

Please sign in to comment.