Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 32 for excption_handler (0.07 sec)

  1. docs/es/docs/tutorial/handling-errors.md

    Y quieres manejar esta excepción globalmente con FastAPI.
    
    Podrías agregar un manejador de excepciones personalizado con `@app.exception_handler()`:
    
    {* ../../docs_src/handling_errors/tutorial003_py39.py hl[5:7,13:18,24] *}
    
    Aquí, si solicitas `/unicorns/yolo`, la *path operation* lanzará un `UnicornException`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 9.7K bytes
    - Viewed (0)
  2. docs_src/handling_errors/tutorial004_py39.py

    from starlette.exceptions import HTTPException as StarletteHTTPException
    
    app = FastAPI()
    
    
    @app.exception_handler(StarletteHTTPException)
    async def http_exception_handler(request, exc):
        return PlainTextResponse(str(exc.detail), status_code=exc.status_code)
    
    
    @app.exception_handler(RequestValidationError)
    async def validation_exception_handler(request, exc: RequestValidationError):
        message = "Validation errors:"
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 920 bytes
    - Viewed (0)
  3. impl/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java

        @Inject
        private LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer;
    
        @Inject
        private LifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator;
    
        @Inject
        private ExceptionHandler exceptionHandler;
    
        protected String getProjectsDirectory() {
            return "src/test/projects/lifecycle-executor";
        }
    
        @Test
        void testCreation() throws Exception {
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  4. docs_src/handling_errors/tutorial003_py39.py

    from fastapi import FastAPI, Request
    from fastapi.responses import JSONResponse
    
    
    class UnicornException(Exception):
        def __init__(self, name: str):
            self.name = name
    
    
    app = FastAPI()
    
    
    @app.exception_handler(UnicornException)
    async def unicorn_exception_handler(request: Request, exc: UnicornException):
        return JSONResponse(
            status_code=418,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 626 bytes
    - Viewed (0)
  5. docs_src/handling_errors/tutorial005_py39.py

    from fastapi.encoders import jsonable_encoder
    from fastapi.exceptions import RequestValidationError
    from fastapi.responses import JSONResponse
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    @app.exception_handler(RequestValidationError)
    async def validation_exception_handler(request: Request, exc: RequestValidationError):
        return JSONResponse(
            status_code=422,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 626 bytes
    - Viewed (0)
  6. impl/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java

            MojoExecutionException mojoEx =
                    new MojoExecutionException("Error executing Jetty: Unable to establish loopback connection", ioEx);
    
            ExceptionHandler exceptionHandler = new DefaultExceptionHandler();
            ExceptionSummary exceptionSummary = exceptionHandler.handleException(mojoEx);
    
            String expectedReference = "http://cwiki.apache.org/confluence/display/MAVEN/ConnectException";
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  7. docs/en/docs/reference/fastapi.md

                - put
                - post
                - delete
                - options
                - head
                - patch
                - trace
                - on_event
                - middleware
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 701 bytes
    - Viewed (0)
  8. 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)
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 03 22:37:12 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  9. impl/maven-core/src/site/apt/index.apt

     evaluate plugin parameters values during Mojo configuration,
    
     * <<<ExceptionHandler>>> component ({{{./apidocs/org/apache/maven/exception/ExceptionHandler.html}javadoc}}),
     with its <<<DefaultExceptionHandler>>> implementation
    Registered: Sun Dec 28 03:35:09 UTC 2025
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  10. docs/ja/docs/tutorial/handling-errors.md

    あなた(または使用しているライブラリ)が`raise`するかもしれないカスタム例外`UnicornException`があるとしましょう。
    
    そして、この例外をFastAPIでグローバルに処理したいと思います。
    
    カスタム例外ハンドラを`@app.exception_handler()`で追加することができます:
    
    {* ../../docs_src/handling_errors/tutorial003.py hl[5,6,7,13,14,15,16,17,18,24] *}
    
    ここで、`/unicorns/yolo`をリクエストすると、*path operation*は`UnicornException`を`raise`します。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 11.6K bytes
    - Viewed (0)
Back to top