Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 68 for oops (0.57 sec)

  1. docs_src/handling_errors/tutorial003_py39.py

    app = FastAPI()
    
    
    @app.exception_handler(UnicornException)
    async def unicorn_exception_handler(request: Request, exc: UnicornException):
        return JSONResponse(
            status_code=418,
            content={"message": f"Oops! {exc.name} did something. There goes a rainbow..."},
        )
    
    
    @app.get("/unicorns/{name}")
    async def read_unicorn(name: str):
        if name == "yolo":
            raise UnicornException(name=name)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 626 bytes
    - Viewed (0)
  2. docs_src/dependencies/tutorial008c_py39.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
            raise InternalError(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 660 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_handling_errors/test_tutorial003.py

    
    def test_get_exception():
        response = client.get("/unicorns/yolo")
        assert response.status_code == 418, response.text
        assert response.json() == {
            "message": "Oops! yolo did something. There goes a rainbow..."
        }
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  4. src/test/java/jcifs/smb1/smb1/SmbExceptionTest.java

         */
        @Test
        @DisplayName("Message + root cause stores root cause")
        void testStringAndThrowableConstructor() {
            Throwable root = mock(Throwable.class);
            SmbException ex = new SmbException("oops", root);
            assertSame(root, ex.getRootCause());
        }
    
        /**
         * Verify that {@link #toString()} includes a stack trace when a root cause
         * is present.
         */
        @Test
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.5K bytes
    - Viewed (0)
  5. src/test/java/jcifs/internal/SMBProtocolDecodingExceptionTest.java

            assertNotNull(ex.toString(), "toString should be safe to call");
        }
    
        @ParameterizedTest
        @NullAndEmptySource
        @ValueSource(strings = { "oops", "multi word", "δΈ­ζ–‡" })
        @DisplayName("Message+Cause constructor: preserves both values; no interactions with cause")
        void messageAndCauseConstructor_preservesBoth(String message) {
            // Arrange & Act
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  6. cmd/erasure-healing-common_test.go

    					f, err := os.OpenFile(filePath, os.O_WRONLY|os.O_SYNC, 0)
    					if err != nil {
    						t.Fatalf("Failed to open %s: %s\n", filePath, err)
    					}
    					f.WriteString("oops") // Will cause bitrot error
    					f.Close()
    					break
    				}
    			}
    
    			rQuorum := len(errs) - z.serverPools[0].sets[0].defaultParityCount
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 22.4K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/collect/PeekingIteratorTest.java

         * throws a RuntimeException when retrieving the nth element.
         *
         * If the PeekingIterator is caching elements too aggressively,
         * it may throw the exception on the (n-1)th element (oops!).
         */
    
        /* Checks the case where the first element throws an exception. */
    
        List<Integer> list = emptyList();
        Iterator<Integer> iterator = peekingIterator(new ThrowsAtEndIterator<Integer>(list));
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 23 17:50:58 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  8. docs/uk/docs/tutorial/handling-errors.md

    АлС Π²ΠΎΠ½Π° Π±ΡƒΠ΄Π΅ ΠΎΠ±Ρ€ΠΎΠ±Π»Π΅Π½Π° Ρ„ΡƒΠ½ΠΊΡ†Ρ–Ρ”ΡŽ-ΠΎΠ±Ρ€ΠΎΠ±Π½ΠΈΠΊΠΎΠΌ `unicorn_exception_handler`.
    
    ΠžΡ‚ΠΆΠ΅, Π’ΠΈ ΠΎΡ‚Ρ€ΠΈΠΌΠ°Ρ”Ρ‚Π΅ Π·Ρ€ΠΎΠ·ΡƒΠΌΡ–Π»Ρƒ ΠΏΠΎΠΌΠΈΠ»ΠΊΡƒ Π·Ρ– HTTP-статусом `418` Ρ– JSON-Π²Ρ–Π΄ΠΏΠΎΠ²Ρ–Π΄Π΄ΡŽ:
    
    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    ```
    
    /// note | Π’Π΅Ρ…Π½Ρ–Ρ‡Π½Ρ– Π΄Π΅Ρ‚Π°Π»Ρ–
    
    Π’ΠΈ Ρ‚Π°ΠΊΠΎΠΆ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ використовувати `from starlette.requests import Request` Ρ– `from starlette.responses import JSONResponse`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 13.9K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/collect/PeekingIteratorTest.java

         * throws a RuntimeException when retrieving the nth element.
         *
         * If the PeekingIterator is caching elements too aggressively,
         * it may throw the exception on the (n-1)th element (oops!).
         */
    
        /* Checks the case where the first element throws an exception. */
    
        List<Integer> list = emptyList();
        Iterator<Integer> iterator = peekingIterator(new ThrowsAtEndIterator<Integer>(list));
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 23 17:50:58 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  10. docs/ru/docs/tutorial/handling-errors.md

    Но ΠΎΠ½ΠΎ Π±ΡƒΠ΄Π΅Ρ‚ ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Π°Π½ΠΎ `unicorn_exception_handler`.
    
    Π’Π°ΠΊΠΈΠΌ ΠΎΠ±Ρ€Π°Π·ΠΎΠΌ, Π²Ρ‹ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΡ‚Π΅ Ρ‡ΠΈΡΡ‚ΡƒΡŽ ΠΎΡˆΠΈΠ±ΠΊΡƒ с ΠΊΠΎΠ΄ΠΎΠΌ состояния HTTP `418` ΠΈ содСрТимым JSON:
    
    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    ```
    
    /// note | ВСхничСскиС Π΄Π΅Ρ‚Π°Π»ΠΈ
    
    Π’Π°ΠΊΠΆΠ΅ ΠΌΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ `from starlette.requests import Request` ΠΈ `from starlette.responses import JSONResponse`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 14.1K bytes
    - Viewed (0)
Back to top