-
Bug
-
Resolution: Done
-
Critical
-
None
As an effect of the heavy usage of logger.critical(...) in convert2rhel codebase, we had to intercept and catch those calls in our action class to prevent the conversion to fail as soon as we hit those places.
The way we are dealing with the logger.critical (SystemExit), and other catch-alls exceptions right now is not ideal, thus, we need to go ahead and replace those calls with proper exceptions, so instead of catching every SystemExit call that we may rise, we will catch specific ones and treat them inside the action class to give the user a better return code and message.
Places that we need to change
- https://github.com/oamg/convert2rhel/pull/764/files#diff-f19e48fc93aad8a757689c26785d32e725a26e59de0c1e36602948f8f488858fR69
- https://github.com/oamg/convert2rhel/pull/764/files#diff-f19e48fc93aad8a757689c26785d32e725a26e59de0c1e36602948f8f488858fR102
- https://github.com/oamg/convert2rhel/pull/764/files#diff-a213badce4ef303a7ecb58bd25f5ee580b27cd115c59c3e06507f43b9304c511R63
- https://github.com/oamg/convert2rhel/pull/764/files#diff-a213badce4ef303a7ecb58bd25f5ee580b27cd115c59c3e06507f43b9304c511R115
- https://github.com/oamg/convert2rhel/pull/764/files#diff-a213badce4ef303a7ecb58bd25f5ee580b27cd115c59c3e06507f43b9304c511R129
- https://github.com/oamg/convert2rhel/pull/764/files#diff-4d4eff0f9c261890d7f273e9dfa9b6aae8bedac80e7bdb1316380841314c4181R59
- https://github.com/oamg/convert2rhel/pull/789/files#diff-262cdb17bc386a2dc269b6612845ddd7d2fd9590063dd7033044b35b9f6deb8cR44
Example of custom exception being used
Acceptance Criteria
- Change all the catch-all exceptions catch from the list above to be a custom exception
- Keep in mind that the list above points to the comment that says where/what is happening to raise those general exceptions.
- Catch that new custom exception inside the action class instead of the general catch-all exceptions.
- NOTE: When you open one of these PRs with updated messages, please CC mportman@redhat.com on the PR so she can let us know if the wording is clear.
- is triggering
-
RHELC-1171 Migrate away from exceptions.CriticalError
- New
- links to
-
RHEA-2023:123163 convert2rhel bug fix and enhancement update
-
RHEA-2023:123165 convert2rhel bug fix and enhancement update