errors
Typed integration error model and classification helpers.
This package provides boundary-aware exceptions for side-effect adapters and a small classifier used to distinguish expected task-level failures from internal/system integration failures.
IntegrationBoundary
Bases: str, Enum
External boundary where an integration failure originated.
Attributes:
| Name | Type | Description |
|---|---|---|
WORKSPACE |
Workspace provisioning/cleanup operations. |
|
SIGNAL |
Instruction/signal publication or completion polling. |
|
PULL_REQUEST |
Pull-request create/merge/status operations. |
|
AGENT_LAUNCH |
Agent process launch or kickoff behavior. |
Source code in src/agentrelay/errors/__init__.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
IntegrationFailureClass
Bases: str, Enum
Classification used for orchestration policy decisions.
Attributes:
| Name | Type | Description |
|---|---|---|
EXPECTED_TASK_FAILURE |
Expected task-level failure (retry policy may apply). |
|
INTERNAL_ERROR |
Internal/system failure (usually fail-fast). |
Source code in src/agentrelay/errors/__init__.py
29 30 31 32 33 34 35 36 37 38 | |
IntegrationError
Bases: Exception
Base integration error carrying boundary and failure classification.
Use raise IntegrationError(...) from original_exc to chain the
underlying cause (accessible via __cause__).
Attributes:
| Name | Type | Description |
|---|---|---|
boundary |
Integration boundary where failure originated. |
|
failure_class |
Classification used by orchestration policy. |
Source code in src/agentrelay/errors/__init__.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
__init__(message, *, boundary, failure_class)
Initialize a boundary-aware integration error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Human-readable error message. |
required |
boundary
|
IntegrationBoundary
|
Boundary where the failure originated. |
required |
failure_class
|
IntegrationFailureClass
|
Classification for orchestration policy. |
required |
Source code in src/agentrelay/errors/__init__.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
ExpectedTaskFailureError
Bases: IntegrationError
Expected task-level failure from an integration boundary.
Source code in src/agentrelay/errors/__init__.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
__init__(message, *, boundary)
Initialize an expected task-level failure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Human-readable error message. |
required |
boundary
|
IntegrationBoundary
|
Boundary where the failure originated. |
required |
Source code in src/agentrelay/errors/__init__.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
InternalIntegrationError
Bases: IntegrationError
Internal/system integration failure from an external boundary.
Source code in src/agentrelay/errors/__init__.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
__init__(message, *, boundary)
Initialize an internal/system integration failure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Human-readable error message. |
required |
boundary
|
IntegrationBoundary
|
Boundary where the failure originated. |
required |
Source code in src/agentrelay/errors/__init__.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
classify_integration_error(exc)
Classify an exception for orchestration retry/fail-fast policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exc
|
BaseException
|
Exception raised by integration code. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
IntegrationFailureClass |
IntegrationFailureClass
|
Expected task failure or internal error.
Non- |
Source code in src/agentrelay/errors/__init__.py
169 170 171 172 173 174 175 176 177 178 179 180 181 | |