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 Section 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.

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 = 'serverFail'#
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 Section 3.6.2 generic error types that may be set as error_type:

  • serverUnavailable: temporary, retrying later may succeed

  • serverFail: unexpected server-side error (default here, used when the server’s response omits type entirely)

  • serverPartialFail: partial failure, some calls succeeded

  • 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

Individual methods define further, method-specific error types beyond this generic set (e.g. notFound, calendarHasEvent, expandDurationTooLarge); see each method builder’s own docstring.

error_type: str = 'serverFail'#

Last updated on 2026-09-11.