Return fastapi http exception to fron from langchain runnable
My backend is running langchain routes with certain runnables. I want to be able to return an http exception like “404 Not found” to the front end, but when I raise it with with raise HTTPException(status_code=404, detail="Item not found")
a CancelledException is created and the frontend recieves “internal server error”. How can I pull this off?