Skip to content

Improve error handling #37

@sam-grant

Description

@sam-grant

It's a bit sloppy at present.

Example: everything falls over but the exception is not propagated up.

[Analyse] ❌ Error during analysis execution: 'CutManager' object has no attribute 'calculate_cut_stats'
[CosmicProcessor] ❌ Error processing /exp/mu2e/data/users/sgrant/mu2e-cosmic/data/nts.mu2e.CosmicCRYSignalAllOffSpillTriggered-LH.MDC2020as_best_v1_3_v06_03_00.001202_00050440.root: 'CutManager' object has no attribute 'calculate_cut_stats'
[pyprocess] ❌ Error processing /exp/mu2e/data/users/sgrant/mu2e-cosmic/data/nts.mu2e.CosmicCRYSignalAllOffSpillTriggered-LH.MDC2020as_best_v1_3_v06_03_00.001202_00050440.root:
'CutManager' object has no attribute 'calculate_cut_stats'
[CosmicProcessor] ✅ Analysis complete
[run] ❌ Analysis failed: name 'info' is not defined

I think top level parent processes should sys.exit(1) on a critical error, and then worker processes should just raise and propagate the exception up. There may be instances where return None is good, need to think about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions