- Sort Score
- Result 10 results
- Languages All
Results 711 - 720 of 1,922 for try (0.02 sec)
-
docs_src/dependencies/tutorial008d.py
from fastapi import Depends, FastAPI, HTTPException app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("We don't swallow the internal error here, we raise again 😎") raise @app.get("/items/{item_id}") def get_item(item_id: str, username: str = Depends(get_username)): if item_id == "portal-gun":
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 694 bytes - Viewed (0) -
scripts/playwright/separate_openapi_schemas/image01.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Sep 13 09:14:46 UTC 2024 - 974 bytes - Viewed (0) -
docs_src/dependencies/tutorial008b.py
"portal-gun": {"description": "Gun to create portals", "owner": "Rick"}, } class OwnerError(Exception): pass def get_username(): try: yield "Rick" except OwnerError as e: raise HTTPException(status_code=400, detail=f"Owner error: {e}") @app.get("/items/{item_id}")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Dec 26 20:37:34 UTC 2023 - 735 bytes - Viewed (0) -
docs_src/dependencies/tutorial008d_an.py
from fastapi import Depends, FastAPI, HTTPException from typing_extensions import Annotated app = FastAPI() class InternalError(Exception): pass def get_username(): try: yield "Rick" except InternalError: print("We don't swallow the internal error here, we raise again 😎") raise @app.get("/items/{item_id}") def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 744 bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/Handshake.kt
peerCertificatesFn: () -> List<Certificate>, ) { /** Returns a possibly-empty list of certificates that identify the remote peer. */ @get:JvmName("peerCertificates") val peerCertificates: List<Certificate> by lazy { try { peerCertificatesFn() } catch (spue: SSLPeerUnverifiedException) { listOf() } } @JvmName("-deprecated_tlsVersion") @Deprecated( message = "moved to val",
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 6.8K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PrintEvents.java
@Override public void onFailure(Call call, IOException e) { } @Override public void onResponse(Call call, Response response) throws IOException { try (ResponseBody body = response.body()) { // Consume and discard the response body. body.source().readByteString(); } } }); Request newYorkTimesRequest = new Request.Builder()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Feb 16 23:20:49 UTC 2020 - 6.1K bytes - Viewed (0) -
src/main/java/jcifs/internal/smb1/com/SmbComTreeConnectAndX.java
if ( isExternalAuth(pwAuth) ) { this.passwordLength = 1; } else if ( this.server.encryptedPasswords ) { // encrypted try { this.password = pwAuth.getAnsiHash(this.ctx, this.server.encryptionKey); } catch ( GeneralSecurityException e ) {
Registered: Sun Nov 03 00:10:13 UTC 2024 - Last Modified: Sun Jul 01 13:12:10 UTC 2018 - 6.6K bytes - Viewed (0) -
docs/en/docs/how-to/custom-request-and-route.md
/// First, we create a `GzipRequest` class, which will overwrite the `Request.body()` method to decompress the body in the presence of an appropriate header. If there's no `gzip` in the header, it will not try to decompress the body. That way, the same route class can handle gzip compressed or uncompressed requests. {* ../../docs_src/custom_request_and_route/tutorial001.py hl[8:15] *} ### Create a custom `GzipRoute` class
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 22:39:38 UTC 2024 - 4.3K bytes - Viewed (0) -
internal/config/heal/heal.go
} const minimumBitrotCycleInMonths = 1 func parseBitrotConfig(s string) (time.Duration, error) { // Try to parse as a boolean enabled, err := config.ParseBool(s) if err == nil { switch enabled { case true: return 0, nil case false: return -1, nil } } // Try to parse as a number of months if !strings.HasSuffix(s, "m") { return -1, errors.New("unknown format") }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri May 24 23:05:23 UTC 2024 - 4.9K bytes - Viewed (0) -
src/test/java/org/codelibs/opensearch/extension/analysis/SynonymLoader.java
} return false; } public SynonymMap getSynonymMap() { return synonymMap; } protected void createSynonymMap(final boolean reload) { try (Reader rulesReader = getReader(reload)) { if (rulesReader instanceof StringReader && ((StringReader) rulesReader).toString().length() == 0) { synonymMap = null; return; }
Registered: Fri Nov 08 09:08:12 UTC 2024 - Last Modified: Thu Feb 22 01:36:54 UTC 2024 - 6.7K bytes - Viewed (0)