X-Git-Url: http://git.annexia.org/?p=ocaml-augeas.git;a=blobdiff_plain;f=augeas.mli;h=a896270a0c12f0f6230cd57fd74fea60d4ff4709;hp=bada127ed7959d19740f268720d6980175828876;hb=f7638380d5d7b67773ae149c4d3206a716dc9a13;hpb=4064f0ec2e3e65b9a611ff7a9721bd3977a010eb diff --git a/augeas.mli b/augeas.mli index bada127..a896270 100644 --- a/augeas.mli +++ b/augeas.mli @@ -21,10 +21,6 @@ type t (** Augeas library handle. *) -exception Error of string - (** This exception is thrown when the underlying Augeas library - returns an error. *) - type flag = | AugSaveBackup (** Rename original with .augsave *) | AugSaveNewFile (** Save changes to .augnew *) @@ -34,6 +30,32 @@ type flag = | AugNoLoad (** Flags passed to the {!create} function. *) +type error_code = + | AugErrInternal (** Internal error (bug) *) + | AugErrPathX (** Invalid path expression *) + | AugErrNoMatch (** No match for path expression *) + | AugErrMMatch (** Too many matches for path expression *) + | AugErrSyntax (** Syntax error in lens file *) + | AugErrNoLens (** Lens lookup failed *) + | AugErrMXfm (** Multiple transforms *) + | AugErrNoSpan (** No span for this node *) + | AugErrMvDesc (** Cannot move node into its descendant *) + | AugErrCmdRun (** Failed to execute command *) + | AugErrBadArg (** Invalid argument in funcion call *) + | AugErrLabel (** Invalid label *) + | AugErrCpDesc (** Cannot copy node into its descendant *) + | AugErrUnknown of int + (** Possible error codes. *) + +exception Error of error_code * string * string * string + (** This exception is thrown when the underlying Augeas library + returns an error. The tuple represents: + - the Augeas error code + - the ocaml-augeas error string + - the human-readable explanation of the Augeas error, if available + - a string with details of the Augeas error + *) + type path = string (** A path expression. @@ -90,3 +112,6 @@ val count_matches : t -> path -> int val save : t -> unit (** [save t] saves all pending changes to disk. *) + +val load : t -> unit + (** [load t] loads files into the tree. *)