mirror of
				https://github.com/deepset-ai/haystack.git
				synced 2025-10-31 09:49:48 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			8 lines
		
	
	
		
			277 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			8 lines
		
	
	
		
			277 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from fastapi import HTTPException
 | |
| from starlette.requests import Request
 | |
| from starlette.responses import JSONResponse
 | |
| 
 | |
| 
 | |
| async def http_error_handler(_: Request, exc: HTTPException) -> JSONResponse:
 | |
|     return JSONResponse({"errors": [exc.detail]}, status_code=exc.status_code)
 | 
