aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Bindings/Python/IRAttributes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Bindings/Python/IRAttributes.cpp')
-rw-r--r--mlir/lib/Bindings/Python/IRAttributes.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/mlir/lib/Bindings/Python/IRAttributes.cpp b/mlir/lib/Bindings/Python/IRAttributes.cpp
index 045c0fb..c0a945e 100644
--- a/mlir/lib/Bindings/Python/IRAttributes.cpp
+++ b/mlir/lib/Bindings/Python/IRAttributes.cpp
@@ -1306,6 +1306,10 @@ PyType_Slot PyDenseElementsAttribute::slots[] = {
e.restore();
nb::chain_error(PyExc_BufferError, "Error converting attribute to buffer");
return -1;
+ } catch (std::exception &e) {
+ nb::chain_error(PyExc_BufferError,
+ "Error converting attribute to buffer: %s", e.what());
+ return -1;
}
view->obj = obj;
view->ndim = 1;