Skip to content

Improve information content in error messages #1057

Description

@HGSilveri

A lot of error messages have been written assuming that the user would hit it "directly" (i.e. when coding in some interactive environment like a Jupyter notebook). Take for example this error:

 ValueError("All samples of an amplitude waveform must be greater than or equal to zero.")

This is fine if the user just tried to create a Pulse. However, if it happens deep inside some function in the code base, potentially coming from the building of some parametrized sequence, it can be harder to tell what is going on. An immediate improvement would be to just add more information in the message, e.g.

 ValueError(f"All samples of an amplitude waveform must be greater than or equal to zero; got negative values for waveform {amp_wf}")

This alone might help narrow down where the error is coming from.

We should do this judiciously throughout the codebase.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions