# gql.transport.exceptions

exception gql.transport.exceptions.TransportError

  Bases: `Exception`

  Base class for all the Transport exceptions

  __init__(*args, **kwargs)
  add_note(object, /)

    Exception.add_note(note) – add a note to the exception

  args
  with_traceback(object, /)

    Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception gql.transport.exceptions.TransportProtocolError

  Bases: `TransportError`

  Transport protocol error.

  The answer received from the server does not correspond to the transport protocol.

  __init__(*args, **kwargs)
  add_note(object, /)

    Exception.add_note(note) – add a note to the exception

  args
  with_traceback(object, /)

    Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception gql.transport.exceptions.TransportServerError(message: str, code: int | None = None)

  Bases: `TransportError`

  The server returned a global error.

  This exception will close the transport connection.

  __init__(message: str, code: int | None = None)
  code: int | None
  add_note(object, /)

    Exception.add_note(note) – add a note to the exception

  args
  with_traceback(object, /)

    Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception gql.transport.exceptions.TransportQueryError(msg: str, query_id: int | None = None, errors: List[Any] | None = None, data: Any | None = None, extensions: Any | None = None)

  Bases: `TransportError`

  The server returned an error for a specific query.

  This exception should not close the transport connection.

  __init__(msg: str, query_id: int | None = None, errors: List[Any] | None = None, data: Any | None = None, extensions: Any | None = None)
  query_id: int | None
  errors: List[Any] | None
  add_note(object, /)

    Exception.add_note(note) – add a note to the exception

  args
  with_traceback(object, /)

    Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

  data: Any | None
  extensions: Any | None

exception gql.transport.exceptions.TransportClosed

  Bases: `TransportError`

  Transport is already closed.

  This exception is generated when the client is trying to use the transport while the transport was previously closed.

  __init__(*args, **kwargs)
  add_note(object, /)

    Exception.add_note(note) – add a note to the exception

  args
  with_traceback(object, /)

    Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception gql.transport.exceptions.TransportConnectionFailed

  Bases: `TransportError`

  Transport connection failed.

  This exception is by the connection adapter code when a connection closed or if an unexpected Exception was received when trying to send a request.

  __init__(*args, **kwargs)
  add_note(object, /)

    Exception.add_note(note) – add a note to the exception

  args
  with_traceback(object, /)

    Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception gql.transport.exceptions.TransportAlreadyConnected

  Bases: `TransportError`

  Transport is already connected.

  Exception generated when the client is trying to connect to the transport while the transport is already connected.

  __init__(*args, **kwargs)
  add_note(object, /)

    Exception.add_note(note) – add a note to the exception

  args
  with_traceback(object, /)

    Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.