Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/blueapi/worker/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from bluesky.run_engine import RunEngineStateMachine
from pydantic import Field, PydanticSchemaGenerationError, TypeAdapter
from pydantic_core import PydanticSerializationError
from super_state_machine.extras import PropertyMachine, ProxyString

from blueapi.utils import BlueapiBaseModel
Expand Down Expand Up @@ -73,8 +74,8 @@ class TaskResult(BlueapiBaseModel):
def from_result(cls, result: Any) -> Self:
type_str = type(result).__name__
try:
value = TypeAdapter(type(result)).dump_python(result)
except PydanticSchemaGenerationError:
value = TypeAdapter(type(result)).dump_python(result, mode="json")
except (PydanticSchemaGenerationError, PydanticSerializationError):
value = None
return cls(result=value, type=type_str)

Expand Down
Loading