Skip to content
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

Raise a custom JobFailure error when a job fails #2410

Merged
merged 9 commits into from
Aug 14, 2024

Conversation

Andrew-S-Rosen
Copy link
Member

@Andrew-S-Rosen Andrew-S-Rosen commented Aug 10, 2024

Summary of Changes

This PR seeks to close #2407 by raising a custom JobFailure exception when a job fails, which can be used to try/except calculations more easily. The JobFailure raises the parent ASE error but also has a directory attribute that can be easily accessed by the user without any need to sift through the log file. The directory info was already being logged, but now it's also present in the traceback. There is also a parent_error attribute to ensure the original exception is still accessible by the end user.

Pinging @tomdemeyere for review.

Requirements

Note: If you are an external contributor, you will see a comment from @buildbot-princeton. This is solely for the maintainers.

@Andrew-S-Rosen Andrew-S-Rosen changed the title Return a custom JobFailure error when a job fails Raise a custom JobFailure error when a job fails Aug 10, 2024
Copy link

codecov bot commented Aug 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.45%. Comparing base (119d281) to head (1d7c269).
Report is 25 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2410   +/-   ##
=======================================
  Coverage   98.45%   98.45%           
=======================================
  Files          84       84           
  Lines        3423     3429    +6     
=======================================
+ Hits         3370     3376    +6     
  Misses         53       53           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Andrew-S-Rosen
Copy link
Member Author

This is ready for review now.

@tomdemeyere
Copy link
Contributor

Looks good! I can't think of anything else to include in the raise, imo the directory is the most important part.

@Andrew-S-Rosen
Copy link
Member Author

I can't think of any issues with this approach so will merge this. I'm going to keep tabs on it just in case something unexpected comes up, but I think it's fine. The parent error is still accessible by the user, which is the important part.

@Andrew-S-Rosen Andrew-S-Rosen merged commit 39cf639 into main Aug 14, 2024
20 of 21 checks passed
@Andrew-S-Rosen Andrew-S-Rosen deleted the terminate_updates branch August 14, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Proposal]: change terminate() to raise a custom Exception containing information.
2 participants