This is an archive of the discontinued LLVM Phabricator instance.

[mlir][mbr] Improve diagnostics on error with `raise from`.
ClosedPublic

Authored by ingomueller-net on Jul 14 2022, 5:21 AM.

Details

Summary

This commit extends the raise statements on errors in user-provided
code with from e clauses that attach the original exception to the one
being raised. This allows to debug the root cause of the error more
easily.

Diff Detail

Event Timeline

ingomueller-net requested review of this revision.Jul 14 2022, 5:21 AM

Thanks for submitting this patch! Added a comment :)

mlir/utils/mbr/mbr/main.py
40–43

How about also including e in error_message string?

Updating D129762: [mlir][mbr] Improve diagnostics on error with raise from.

Also giving more details about the root exception in the short message
where that hadn't been done yet.

SaurabhJha accepted this revision.Jul 15 2022, 6:02 AM

Looks great, thank you!

This revision is now accepted and ready to land.Jul 15 2022, 6:02 AM