Skip to content

Commit 6afadee

Browse files
committed
update demo api to rause from err
1 parent faf1bd2 commit 6afadee

File tree

1 file changed

+1
-1
lines changed
  • src/fair_python_cookiecutter/template/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.project_package }}

1 file changed

+1
-1
lines changed

src/fair_python_cookiecutter/template/{{ cookiecutter.project_slug }}/src/{{ cookiecutter.project_package }}/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def calc(op: CalcOperation, x: int, y: int = 0):
1717
err = f"Cannot divide x={x} by y=0!"
1818
else:
1919
err = str(e)
20-
raise HTTPException(status_code=422, detail=err)
20+
raise HTTPException(status_code=422, detail=err) from e
2121

2222
def run():
2323
import uvicorn

0 commit comments

Comments
 (0)