Invoke aug_init with AUG_NO_ERR_CLOSE, so it is possible to provide a
detailed Augeas.Error exception.
flags |= flag_map[i];
}
- t = aug_init (root, loadpath, flags);
+ /* Pass AUG_NO_ERR_CLOSE so we raise a detailed Augeas.Error. */
+ t = aug_init (root, loadpath, flags | AUG_NO_ERR_CLOSE);
if (t == NULL)
raise_init_error ("Augeas.create");
+ if (aug_error (t) != AUG_NOERROR) {
+ raise_error_and_maybe_close (t, "Augeas.init", true);
+ }
+
CAMLreturn (Val_augeas_t (t));
}