Skip to content

Have an error if a device composite is not found in the blueapi context #1526

@noemifrisina

Description

@noemifrisina

When injecting a device composite instead of a single device, if the composite has not been added to the module and not discoverable by blueapi, the only error that will show up on the blueapi logs is a PydanticInvalidForJsonSchema pointing to the first device in the composite, eg

raise self._value
pydantic.errors.PydanticInvalidForJsonSchema: Cannot generate a JsonSchema for core_schema.IsInstanceSchema (<class 'dodal.devices.beamlines.i19.diffractometer.FourCircleDiffractometer'>)

This is a bit confusing because it doesn't really give any information about where the error might be - in particular when the device otherwise connects and is used in other plans.

Related to #1525 . Run into this while testing on I19 and couldn't figure out what was missing until I took a look at the planFunctions module used in hyperion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions