- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 68 for oops (0.57 sec)
-
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) -
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) -
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) -
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. */ @TestRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 4.5K bytes - Viewed (0) -
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) -
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) -
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) -
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) -
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) -
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)