Uvicorn reload is always stuck at the except block and never runs the try part #2261
Unanswered
piyush-jhawar
asked this question in
Potential Issue
Replies: 1 comment 3 replies
-
Please provide an MRE. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
from fastapi import FastAPI
app = FastAPI()
x = 1
while True:
try:
a = 1/x
print("working fine")
break
except ZeroDivisionError:
print("Division error")
First run the code with value of x as 1 and then change x to 0 and save, it will end up in except and change the value of x again to 1.
Beta Was this translation helpful? Give feedback.
All reactions