mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
211 stars 124 forks source link

Setting invalid value is not an exception #38360

Closed peterfpeterson closed 3 weeks ago

peterfpeterson commented 3 weeks ago

EnuperatedStringProperty threw an exception when given bad input rather than return an error message. This fixes that problem and adds tests to exercise the behavior.

The original issue is that bringing up the algorithm dialog for Rebin crashed the dialog so users couldn't run it. This fixes the crash, but the widget for the property is wrong and will be fixed soon.

There is no associated issue, but it is associated with EWM7925

To test:

  1. Start mantidworkbench
  2. Open the dialog for Rebin
  3. See that it doesn't crash

This does not require release notes because it fixes an issue introduced during the development cycle.


Reviewer

Please comment on the points listed below (full description). Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

Functional Tests

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

rboston628 commented 3 weeks ago

Pulled and built branch, opened workbench, ran Rebin from the GUI like a barbarian. It presents this dialog image

It is technically possible to select two options from the list presented, but doing so makes the property invalid (has red asterisk) image