let eraise input = function
    | Failure msg -> error input "Failure '%s'" msg
    | exn -> error input "Failure '%s'" (Printexc.to_string exn)