X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=DEVEL%2Focaml-http%2Fhttp_misc.ml;h=daa81f3b7085d342f94d53e7a45a63eabce224f0;hb=378a122bd40f832581ee3e82cc428584b6579a57;hp=abe6702c2a0aedb11541ffd09b672248a633083f;hpb=d17988855a2e85dc2db641d11ce481c266038ef3;p=helm.git diff --git a/DEVEL/ocaml-http/http_misc.ml b/DEVEL/ocaml-http/http_misc.ml index abe6702c2..daa81f3b7 100644 --- a/DEVEL/ocaml-http/http_misc.ml +++ b/DEVEL/ocaml-http/http_misc.ml @@ -144,3 +144,11 @@ let list_assoc_all key pairs = let warn msg = prerr_endline (sprintf "ocaml-http WARNING: %s" msg) let error msg = prerr_endline (sprintf "ocaml-http ERROR: %s" msg) +let finally at_end f arg = + let res = + try f arg + with exn -> at_end (); raise exn + in + at_end (); + res +