Skip to main content
Every SDK error inherits from MudraIDError.
from mudraid import Agent, MudraIDError

try:
    response = agent.get(url)
except MudraIDError as exc:
    log.warning("SDK rejected the call: %s", exc)

The subclasses

ExceptionRaised when
MudraIDConfigErrorMUDRAID_API_KEY_ID or MUDRAID_SECRET missing or empty
MudraIDAuthErrorMudraID rejected the credentials (401 from /api/v1/auth/token)
MudraIDRevokedErrorAccess denied (403: agent inactive, no platform access, scope rejected)
MudraIDNetworkErrorCould not reach MudraID, or the response was malformed
MudraIDPlatformNotRegisteredErrorThe URL’s host isn’t a registered platform for this agent

Platform errors pass through

A 4xx or 5xx from the platform comes back as a normal Response. The SDK does not raise it. The one exception is 401, which the SDK retries once after refreshing the token. For the full how-to, see Handle errors.