[ocaml] rename failure -> error; raise SfError & TypeError; add comments