[mlir][mbr] Improve diagnostics on error with `raise from`.
authorIngo Müller <ingomueller@google.com>
Thu, 14 Jul 2022 12:17:29 +0000 (12:17 +0000)
committerIngo Müller <ingomueller@google.com>
Fri, 15 Jul 2022 15:15:58 +0000 (15:15 +0000)
commitb9f5b02fd071d494f828c3c9c2b25c671a457928
tree8ead9be1d23bebaaa1cb5e5f4e16304b882a801a
parent2b2697b7d79c510ff6f72d8612033c1d253a78a1
[mlir][mbr] Improve diagnostics on error with `raise from`.

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.

Reviewed By: SaurabhJha

Differential Revision: https://reviews.llvm.org/D129762
mlir/utils/mbr/mbr/main.py