constellation icon indicating copy to clipboard operation
constellation copied to clipboard

Alter functions in Utility classes to throw exceptions rather than catch

Open antares1470 opened this issue 2 years ago • 4 comments

Prerequisites

  • [ ] Put an X between the brackets on this line if you have done all of the following:

    • Running the latest version of Constellation

    • Attached the Support Package via Help > Support Package

    • Checked the FAQs: https://github.com/constellation-app/constellation/wiki/FAQ

    • Checked that your issue isn’t already filed: https://github.com/constellation-app/constellation/issues

    • Checked that there is not already a module that provides the described functionality: https://github.com/constellation-app/constellation/wiki/Catalogue-of-Repositories

Description

Utility functions are designed to be able to be used in multiple different situations. Consequently when an exception occurs, the likely trigger for said exception type may differ depending on the situation the function is called in.

In order to allow for these different situations, the exceptions should be thrown from the utility function rather than caught. This leaves the exception handling then to where the function was called, allowing it to be handled more meaningfully with respect to the situation (e.g. a more meaningful error message for users) rather than constructing a generic response (which would need to happen if caught in the utility function itself).

Expected behaviour: All utility functions throw all their exceptions and catch none

Actual behaviour: Some utility functions catch at least one of their exceptions

Reproduces how often: ? (wasn't going to calculate the % of utility functions catching exceptions but there are some in there)

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

antares1470 avatar Nov 03 '21 04:11 antares1470

This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.

github-actions[bot] avatar May 03 '22 00:05 github-actions[bot]

This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.

github-actions[bot] avatar Dec 28 '22 00:12 github-actions[bot]

This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.

github-actions[bot] avatar Aug 09 '23 00:08 github-actions[bot]

This issue is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this issue.

github-actions[bot] avatar Feb 11 '24 00:02 github-actions[bot]