Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for catching_dep (0.06 sec)

  1. tests/test_dependency_after_yield_raise.py

        pass
    
    
    def catching_dep() -> Any:
        try:
            yield "s"
        except CustomError as err:
            raise HTTPException(status_code=418, detail="Session error") from err
    
    
    def broken_dep() -> Any:
        yield "s"
        raise ValueError("Broken after yield")
    
    
    app = FastAPI()
    
    
    @app.get("/catching")
    def catching(d: Annotated[str, Depends(catching_dep)]) -> Any:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 1.7K bytes
    - Viewed (0)
Back to top