Skip to content

Commit 05f796b

Browse files
committed
Since Python 3.11 and [bpo-40066](python/cpython#84247), Enum.__str__ shows the enum name.
Adjust the error message to only show the string value.
1 parent 2f86537 commit 05f796b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/a2a/server/request_handlers/default_request_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ async def _setup_message_execution(
195195
if task.status.state in TERMINAL_TASK_STATES:
196196
raise ServerError(
197197
error=InvalidParamsError(
198-
message=f'Task {task.id} is in terminal state: {task.status.state}'
198+
message=f'Task {task.id} is in terminal state: {task.status.state.value}'
199199
)
200200
)
201201

@@ -437,7 +437,7 @@ async def on_resubscribe_to_task(
437437
if task.status.state in TERMINAL_TASK_STATES:
438438
raise ServerError(
439439
error=InvalidParamsError(
440-
message=f'Task {task.id} is in terminal state: {task.status.state}'
440+
message=f'Task {task.id} is in terminal state: {task.status.state.value}'
441441
)
442442
)
443443

0 commit comments

Comments
 (0)