Spaces:
Runtime error
Runtime error
Download core/exceptions.py from madhurithika22/Moulding: direct link, hf CLI and curl.
- Browser
- Download file 515 Bytes
-
https://huggingface.co/spaces/madhurithika22/Moulding/resolve/main/core/exceptions.py
- Command line
-
hf download hf://spaces/madhurithika22/Moulding/core/exceptions.py
-
curl -L -o exceptions.py https://huggingface.co/spaces/madhurithika22/Moulding/resolve/main/core/exceptions.py
515 Bytes
| from fastapi import Request | |
| from fastapi.responses import JSONResponse | |
| class IDPProcessingError(Exception): | |
| def __init__(self, message: str, task_id: str = None): | |
| self.message = message | |
| self.task_id = task_id | |
| async def idp_exception_handler(request: Request, exc: IDPProcessingError): | |
| return JSONResponse( | |
| status_code=500, | |
| content={ | |
| "error": "Processing Pipeline Failed", | |
| "message": exc.message, | |
| "task_id": exc.task_id | |
| }, | |
| ) |