Skip to content

Commit d2696ae

Browse files
committed
Add __str__ to ErrorCategory enum for clean string representation
- Return self.value from ErrorCategory.__str__ so formatted strings like f"failed:{category}" produce "failed:permission" instead of "failed:ErrorCategory.PERMISSION"
1 parent bc1312e commit d2696ae

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

teaagent/errors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ class ErrorCategory(str, Enum):
99
PERMISSION = 'permission'
1010
SYSTEM = 'system'
1111

12+
def __str__(self) -> str:
13+
return self.value
14+
1215

1316
class AgentHarnessError(Exception):
1417
category = ErrorCategory.SYSTEM

0 commit comments

Comments
 (0)