Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 34 for Oops (0.02 sec)

  1. docs_src/dependencies/tutorial008c.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 Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 660 bytes
    - Viewed (0)
  2. docs_src/dependencies/tutorial008c_an_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: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 700 bytes
    - Viewed (0)
  3. tests/test_exception_handlers.py

    
    @app.get("/request-validation/{param}/")
    def route_with_request_validation_exception(param: int):
        pass  # pragma: no cover
    
    
    @app.get("/server-error")
    def route_with_server_error():
        raise RuntimeError("Oops!")
    
    
    def test_override_http_exception():
        response = client.get("/http-exception")
        assert response.status_code == 200
        assert response.json() == {"exception": "http-exception"}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Feb 17 12:40:12 UTC 2022
    - 1.9K bytes
    - Viewed (0)
  4. docs_src/handling_errors/tutorial003.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 Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 626 bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial008c_an.py

    from typing_extensions import Annotated
    
    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: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 710 bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/SingletonImmutableSet.java

    @ElementTypesAreNonnullByDefault
    final class SingletonImmutableSet<E> extends ImmutableSet<E> {
      // We deliberately avoid caching the asList and hashCode here, to ensure that with
      // compressed oops, a SingletonImmutableSet packs all the way down to the optimal 16 bytes.
    
      final transient E element;
    
      SingletonImmutableSet(E element) {
        this.element = Preconditions.checkNotNull(element);
      }
    
      @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/SingletonImmutableSet.java

    @ElementTypesAreNonnullByDefault
    final class SingletonImmutableSet<E> extends ImmutableSet<E> {
      // We deliberately avoid caching the asList and hashCode here, to ensure that with
      // compressed oops, a SingletonImmutableSet packs all the way down to the optimal 16 bytes.
    
      final transient E element;
    
      SingletonImmutableSet(E element) {
        this.element = Preconditions.checkNotNull(element);
      }
    
      @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  8. 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 Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  9. src/main/java/jcifs/dcerpc/msrpc/lsarpc.idl

    		SID_NAME_WKN_GRP  = 5, /* well-known group */
    		SID_NAME_DELETED  = 6, /* deleted account: needed for c2 rating */
    		SID_NAME_INVALID  = 7, /* invalid account */
    		SID_NAME_UNKNOWN  = 8  /* oops. */
    	} LsarSidType;
    
    	typedef struct {
    		LsarSidType sid_type;
    		uint32_t rid;
    		uint32_t sid_index;
    	} LsarTranslatedSid;
    
    	typedef struct {
    		[range(0,1000)] uint32_t count;
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Sun Jul 01 13:12:10 UTC 2018
    - 3.1K bytes
    - Viewed (0)
  10. src/main/java/jcifs/smb1/dcerpc/msrpc/lsarpc.idl

    		SID_NAME_WKN_GRP  = 5, /* well-known group */
    		SID_NAME_DELETED  = 6, /* deleted account: needed for c2 rating */
    		SID_NAME_INVALID  = 7, /* invalid account */
    		SID_NAME_UNKNOWN  = 8  /* oops. */
    	} LsarSidType;
    
    	typedef struct {
    		LsarSidType sid_type;
    		uint32_t rid;
    		uint32_t sid_index;
    	} LsarTranslatedSid;
    
    	typedef struct {
    		[range(0,1000)] uint32_t count;
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Fri Mar 22 20:39:42 UTC 2019
    - 3.1K bytes
    - Viewed (0)
Back to top