oelint-adv icon indicating copy to clipboard operation
oelint-adv copied to clipboard

refactor broad exception clauses

Open HerrMuellerluedenscheid opened this issue 2 years ago • 4 comments

Refactored a couple of exception clauses. I also removed some except Exception entirely. They should be used with a lot of care and in cases where there is absolutely no way of getting around this, they should be documented within the code.

HerrMuellerluedenscheid avatar Nov 07 '21 18:11 HerrMuellerluedenscheid

Has it already payed off? https://github.com/priv-kweihmann/oelint-adv/runs/4132063894?check_suite_focus=true

Is this an expected exception @priv-kweihmann?

HerrMuellerluedenscheid avatar Nov 07 '21 19:11 HerrMuellerluedenscheid

Also here I have to veto against merging it. The exception inside of the rule loading method has to be safe so users can run the tool even when a single (custom) is not loadable (there used to be a warning print out for that).

Also the run-method inside of main might be imported to a different utility so this has be safe and not only the outer scope/calling function.

priv-kweihmann avatar Nov 07 '21 19:11 priv-kweihmann

Also here I have to veto against merging it. The exception inside of the rule loading method has to be safe so users can run the tool even when a single (custom) is not loadable (there used to be a warning print out for that).

Also the run-method inside of main might be imported to a different utility so this has be safe and not only the outer scope/calling function.

TBH: I find that pretty speculative and not a reasonable justification for using this construction of try-except which will (and apparently has) lead to hard to trace or even undiscovered errors! But as you like

HerrMuellerluedenscheid avatar Nov 07 '21 20:11 HerrMuellerluedenscheid

Re-opening after todays call. Exceptions need to be caught when loading rules to ensure overall stable program executiong but have to be communicated very prominent in the logs/terminal output.

HerrMuellerluedenscheid avatar Nov 10 '21 15:11 HerrMuellerluedenscheid