raise exception if not in manager mode #207
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of work
This adds an exception for when trying to redefine a reflectometry parameter if the instrument is not in manager mode.
As our plans/plan stubs don't do any redefining in this library other than redefine_refl_param() which will feed-through the exception I think this is all we need to do - IMO it should actually halt a plan and therefore the exception doesn't need to be caught on the top-level plan. This should mean it's a bit more readable to the user that their redefine has failed.
Ticket
Closes #146 and probably #189
Labels
Add appropriate label(s) to this PR
Labels can be found of the right-hand sidebar of this PR once created
Acceptance criteria
If not in manager mode, a nicer error is displayed. If in manager mode, redefines still work.
Documentation
Highlight and provide a link to any additions or changes to the documentation, if applicable. The aim is provide information to help the reviewer