let exn_res r = match r with | `Ok x -> x | `Error e -> raise e