Skip to content

Error Hierarchy

All Dockrion errors extend DockrionError and follow a consistent pattern: each has a message, code, and to_dict() method.

class DockrionError(Exception):
def __init__(self, message: str, code: str = "INTERNAL_ERROR"):
self.message = message
self.code = code
def to_dict(self) -> dict:
return {"message": self.message, "code": self.code}
Error ClassCodeTypical Trigger
DockrionErrorINTERNAL_ERRORBase class, unexpected errors
ValidationErrorVALIDATION_ERRORSchema validation, input validation, bad format
AuthErrorAUTH_ERRORMissing/invalid credentials
RateLimitErrorRATE_LIMIT_EXCEEDEDRate limit hit (when enforcement is implemented)
NotFoundErrorNOT_FOUNDResource not found (e.g., run ID)
ConflictErrorCONFLICTConflicting operations
ServiceUnavailableErrorSERVICE_UNAVAILABLEDependent service unavailable
DeploymentErrorDEPLOYMENT_ERRORBuild or deployment failure
PolicyViolationErrorPOLICY_VIOLATIONSafety policy triggered

MissingSecretError — extends DockrionError:

class MissingSecretError(DockrionError):
def __init__(self, missing: list):
self.missing_secrets = missing
# message: "Missing required secrets: ..."
def to_dict(self):
return {
"message": self.message,
"code": self.code,
"missing_secrets": self.missing_secrets
}

BuildConflictError — extends DockrionError:

class BuildConflictError(DockrionError):
def __init__(self, message: str, conflicts: list = None):
self.conflicts = conflicts or []
def to_dict(self):
return {
"message": self.message,
"code": self.code,
"conflicts": self.conflicts
}

All extend AdapterError which extends DockrionError:

Error ClassCodeExtra FieldsTrigger
AdapterErrorADAPTER_ERRORBase for adapter errors
AdapterLoadErrorADAPTER_LOAD_ERRORFailed to load agent module
ModuleNotFoundErrorMODULE_NOT_FOUNDmodule_pathPython module import failed
CallableNotFoundErrorCALLABLE_NOT_FOUNDmodule_path, callable_nameFunction/class not in module
InvalidAgentErrorINVALID_AGENTAgent doesn’t match expected shape
AdapterNotLoadedErrorADAPTER_NOT_LOADEDinvoke() called before load()
AgentExecutionErrorAGENT_EXECUTION_ERRORError during agent execution
AgentCrashedErrorAGENT_CRASHEDoriginal_errorUnexpected crash wrapper
InvalidOutputErrorINVALID_OUTPUTactual_typeAgent returned non-dict
Error ClassExtra FieldsTrigger
BackendErrorbackendBase for backend errors
BackendConnectionErrorbackendCannot connect to Redis
BackendPublishErrorbackendFailed to publish event
BackendSubscribeErrorbackendFailed to subscribe

DependencyConflictError — from dockrion_sdk.dependencies:

class DependencyConflictError(Exception):
def __init__(self, package, user_constraint, dockrion_constraint, message, resolution_hints=None):
...

Raised when user dependencies conflict with Dockrion’s requirements in an unresolvable way.

In the runtime, errors are converted to HTTP responses:

Error TypeHTTP StatusResponse Body
AuthError401{"detail": {"message": "...", "code": "AUTH_ERROR"}}
RateLimitError429{"detail": {"message": "...", "code": "RATE_LIMIT_EXCEEDED"}}
ValidationError400ErrorResponse with "VALIDATION_ERROR"
PolicyViolationError400ErrorResponse with "POLICY_VIOLATION"
AgentExecutionError500ErrorResponse with "AGENT_EXECUTION_ERROR"
NotFoundError404ErrorResponse with "NOT_FOUND"

Source: packages/common-py/dockrion_common/errors.py; packages/adapters/dockrion_adapters/errors.py; packages/events/dockrion_events/backends/base.py


Previous: Adapters Reference