Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for anders (0.3 sec)

  1. docs_src/handling_errors/tutorial006.py

    from fastapi import FastAPI, HTTPException
    from fastapi.exception_handlers import (
        http_exception_handler,
        request_validation_exception_handler,
    )
    from fastapi.exceptions import RequestValidationError
    from starlette.exceptions import HTTPException as StarletteHTTPException
    
    app = FastAPI()
    
    
    @app.exception_handler(StarletteHTTPException)
    async def custom_http_exception_handler(request, exc):
        print(f"OMG! An HTTP error!: {repr(exc)}")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Aug 09 11:10:33 GMT 2020
    - 928 bytes
    - Viewed (0)
  2. .github/actions/people/app/main.py

        maintainers = []
        for login in maintainers_logins:
            user = authors[login]
            maintainers.append(
                {
                    "login": login,
                    "answers": experts_results.commenters[login],
                    "prs": contributors_results.contributors[login],
                    "avatarUrl": user.avatarUrl,
                    "url": user.url,
                }
            )
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  3. fastapi/exception_handlers.py

    Kristján Valur Jónsson <******@****.***> 1686510494 +0000
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  4. tests/test_exception_handlers.py

    
    def server_error_exception_handler(request, exception):
        return JSONResponse(status_code=500, content={"exception": "server-error"})
    
    
    app = FastAPI(
        exception_handlers={
            HTTPException: http_exception_handler,
            RequestValidationError: request_validation_exception_handler,
            Exception: server_error_exception_handler,
        }
    )
    
    client = TestClient(app)
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Feb 17 12:40:12 GMT 2022
    - 1.9K bytes
    - Viewed (0)
Back to top