mirage / ocaml-vhd

Read and write .vhd format data
Other
9 stars 20 forks source link

Fix exception handling in lwt really_{read,write} #50

Closed robhoes closed 6 years ago

robhoes commented 6 years ago

The really_read and really_write functions in iO.ml (currently in vhd_format_lwt/) were changed to drop their use of lwt_try in d2c6405c. Instead, the code now uses Lwt.catch directly.

The camlp4 extension for lwt_try automatically adds a default exception handler of | exn -> Lwt.fail exn to the with clause. However, this was not added in the above commit. For exceptions that aren't explicitly matched by the handler that is passed to Lwt.catch, this leads to Match_failure exceptions being raised rather than the actual exception being passed up with Lwt.fail.

Signed-off-by: Rob Hoes rob.hoes@citrix.com