Skip to content

Better error message if using new device manager without the new environment variable #1359

@olliesilvester

Description

@olliesilvester

If BlueAPI is running and using a dodal module which defines its devices using the new device factory, eg like

@devices.factory()
def smargon() -> Smargon:
    return Smargon(f"{PREFIX.beamline_prefix}-MO-SGON-01:")

and if the blueapi's values.yaml is missing the new environment variable required, eg

        - kind: deviceManager
          module: dodal.beamlines.i04

then posting a plan will give a BlueAPI validation error which isn't very obvious. The message body on the validation error response looks like: Value error, Device smargon is not of type dodal.devices.smargon.Smargon (etc for all devices in the plan you were trying to run). I didn't really have any idea where to look from that error message.

It would be really helpful if the error message pointed out that the deviceManager configuration was missing

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