class_docstr: An HTTP exception you can raise in your own code to show errors to the client.
  
  This is for client errors, invalid authentication, invalid data, etc. Not for server
  errors in your code.
  
  Read more about it in the
  [FastAPI docs for Handling Errors](https://fastapi.tiangolo.com/tutorial/handling-errors/).
  
  ## Example
  
  ```python
  from fastapi import FastAPI, HTTPException
  
  app = FastAPI()
  
  items = {"foo": "The Foo Wrestlers"}
  
  
  @app.get("/items/{item_id}")
  async def read_item(item_id: str):
      if item_id not in items:
          raise HTTPException(status_code=404, detail="Item not found")
      return {"item": items[item_id]}
  ```
class_docstr_tok: ["An","HTTP","exception","you","can","raise","in","your","own","code","to","show","errors","to","the","client",".","This","is","for","client","errors",",","invalid","authentication",",","invalid","data",",","etc",".","Not","for","server","errors","in","your","code",".","Read","more","about","it","in","the","[","FastAPI","docs","for","Handling","Errors","]","(","https",":","\/\/fastapi.tiangolo.com\/tutorial\/handling-errors\/",")",".","#","#","Example","``","`","python","from","fastapi","import","FastAPI",",","HTTPException","app","=","FastAPI","(",")","items","=","{","``","foo","''",":","``","The","Foo","Wrestlers","''","}","@","app.get","(","``","\/items\/","{","item_id","}","''",")","async","def","read_item","(","item_id",":","str",")",":","if","item_id","not","in","items",":","raise","HTTPException","(","status_code=404",",","detail=","''","Item","not","found","''",")","return","{","``","item","''",":","items","[","item_id","]","}","``","`"]
code: def __init__(
      self,
      status_code: Annotated[
          int,
          Doc(
              """
                  HTTP status code to send to the client.
                  """
          ),
      ],
      detail: Annotated[
          Any,
          Doc(
              """
                  Any data to be sent to the client in the `detail` key of the JSON
                  response.
                  """
          ),
      ] = None,
      headers: Annotated[
          Optional[Dict[str, str]],
          Doc(
              """
                  Any headers to send to the client in the response.
                  """
          ),
      ] = None,
  ) -> None:
      super().__init__(
          status_code=status_code, detail=detail, headers=headers
      )
  
imports: from typing import Any, Dict, Optional, Sequence, Type, Union
  from pydantic import BaseModel, create_model
  from starlette.exceptions import HTTPException
  from starlette.exceptions import WebSocketException
  from typing_extensions import Annotated, Doc
label_desc: Use image node_id 1 to create a new HTTPException object from inherited base classes: StarletteHTTPException with example: obj = HTTPException(status_code, detail, headers)