cta-observatory / cta-lstchain

LST prototype testbench chain
https://cta-observatory.github.io/cta-lstchain/
BSD 3-Clause "New" or "Revised" License
25 stars 77 forks source link

Broken try...except in dl1 to dl2 #1022

Open LukasNickel opened 2 years ago

LukasNickel commented 2 years ago

The try...except block in the dl1_to_dl2 script is broken: https://github.com/cta-observatory/cta-lstchain/blob/089f641dc1614e3ae5cd6358ff2aab7f0da58b48/lstchain/scripts/lstchain_dl1_to_dl2.py#L80

This should catch an exception and print the message. Currently it rightfully throws an error: TypeError: catching classes that do not inherit from BaseException is not allowed. when handling the underlying exception.

The script runs fine if there is no error and fails if there is one. Its just that there is an additional non helpful error message printed.

maxnoe commented 2 years ago

This should catch an exception and print the message.

No, it should just raise! "Silently" ignoring that a user specified config file could not be loaded is not ok and will lead to unexpected results since nobody reads log files of successful jobs...