New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch pallet initialization errors #65
Comments
def global_exception_handler(ex_cls, ex, tb):
import traceback
last_traceback = (traceback.extract_tb(tb))[-1]
line_number = last_traceback[1]
file_name = last_traceback[0].split(".")[0]
logger.log(traceback.format_exception(ex_cls, ex, tb), stdout=testing)
mailman.deliver('crash-db error', logger.print_log())
if testing:
traceback.print_exception(ex_cls, ex, tb)
logger.log(logger.print_log(), stdout=testing)
logger.log(("line:%s (%s)" % (line_number, file_name)), stdout=testing)
sys.excepthook = global_exception_handler We could do something like this in forklift so we get notified of areas that crash the entire process. |
What are your thoughts on moving all errorable logic out of |
How would that make it easier on forklift? Would we still need the try/except around that method? |
yes but it would be out of the cli method to just add a pallet to a list and into the lift method where the processing would be happening. |
That's fine with me. |
Steps to reproduce
__init__
Expected behavior
I would expect forklift to complete successfully and show the error raised for that pallet.
Actual behavior
Forklift chokes and crashes without processing any subsequent pallets.
I think that we should probably wrap this code in a try/except. On except we may need to create a fake pallet with the appropriate
success
tuple.The text was updated successfully, but these errors were encountered: