Errors#

RFC 8620 Section 3.6.2 defines the error types a JMAP method call can return; JMAPMethodError carries one of these as its error_type attribute. See its docstring below for the full list.

JMAP error hierarchy.

RFC 8620 §3.6.2 defines the standard method-level error types.

If caldav happens to be installed alongside this package, JMAPError and JMAPAuthError subclass its DAVError/AuthorizationError too, so code that catches caldav.lib.error.DAVError around CalDAV calls also catches JMAP errors raised here. There is no hard dependency on caldav, just an optional compatibility hook when it’s present.

exception calendaring_jmap.error.JMAPAuthError(url: str | None = None, reason: str | None = None, error_type: str | None = None)[source]#

Bases: _CaldavAuthorizationError, JMAPError

HTTP 401 or 403 received from a JMAP server.

Unlike CalDAV, JMAP does not use a 401-challenge-retry dance. A 401/403 on the session GET or any API call is a hard failure.

error_type: str = 'forbidden'#
reason: str = 'Authentication failed'#
exception calendaring_jmap.error.JMAPBaseError(url: str | None = None, reason: str | None = None)[source]#

Bases: _CaldavDAVError

Base for all calendaring-jmap errors: a URL, a reason, nothing more.

reason: str = 'no reason'#
url: str | None = None#
exception calendaring_jmap.error.JMAPCapabilityError(url: str | None = None, reason: str | None = None, error_type: str | None = None)[source]#

Bases: JMAPError

Server does not advertise the required JMAP capability.

Raised when the Session object returned by the server does not include urn:ietf:params:jmap:calendars in the account capabilities.

error_type: str = 'capabilityNotSupported'#
reason: str = 'Server does not support urn:ietf:params:jmap:calendars'#
exception calendaring_jmap.error.JMAPError(url: str | None = None, reason: str | None = None, error_type: str | None = None)[source]#

Bases: JMAPBaseError

Base class for all JMAP protocol errors.

Adds error_type to carry the RFC 8620 error type string (e.g. "unknownMethod", "invalidArguments").

error_type: str = 'serverError'#
exception calendaring_jmap.error.JMAPMethodError(url: str | None = None, reason: str | None = None, error_type: str | None = None)[source]#

Bases: JMAPError

A JMAP method call returned an error response.

RFC 8620 §3.6.2 error types that may be set as error_type:

  • serverError — unexpected server-side error

  • unknownMethod — method name not recognised

  • invalidArguments — bad argument types or values

  • invalidResultReference — bad #result reference

  • forbidden — not allowed to perform this call

  • accountNotFound — accountId does not exist

  • accountNotSupportedByMethod — account lacks needed capability

  • accountReadOnly — account is read-only

  • requestTooLarge — request exceeds server limits

  • stateMismatch — ifInState check failed

  • serverPartialFail — partial failure; some calls succeeded

  • notFound — requested object does not exist

  • notDraft — object is not in draft state

error_type: str = 'serverError'#