From: Pino Toscano Date: Wed, 13 Sep 2017 16:25:00 +0000 (+0200) Subject: Raise Out_of_memory when Augeas fails with AUG_ENOMEM X-Git-Tag: v0.6~27 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=62f4b1532b3b55da5b46043da9d44138ce5e48c4;p=ocaml-augeas.git Raise Out_of_memory when Augeas fails with AUG_ENOMEM This is more in style with what OCaml reports in this kind of situations. --- diff --git a/augeas-c.c b/augeas-c.c index 7ca7244..5c330a8 100644 --- a/augeas-c.c +++ b/augeas-c.c @@ -35,6 +35,11 @@ typedef augeas *augeas_t; static void raise_error (augeas_t t, const char *msg) { + const int code = aug_error (t); + + if (code == AUG_ENOMEM) + caml_raise_out_of_memory (); + caml_raise_with_string (*caml_named_value ("Augeas.Error"), msg); }