1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
(**************************************************************************)
(* Copyright © 2009-2013 Stéphane Glondu <steph@glondu.net> *)
(* © 2010-2013 Mehdi Dogguy <mehdi@dogguy.org> *)
(* *)
(* This program is free software: you can redistribute it and/or modify *)
(* it under the terms of the GNU Affero General Public License as *)
(* published by the Free Software Foundation, either version 3 of the *)
(* License, or (at your option) any later version, with the additional *)
(* exemption that compiling, linking, and/or using OpenSSL is allowed. *)
(* *)
(* This program is distributed in the hope that it will be useful, but *)
(* WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *)
(* Affero General Public License for more details. *)
(* *)
(* You should have received a copy of the GNU Affero General Public *)
(* License along with this program. If not, see *)
(* <http://www.gnu.org/licenses/>. *)
(**************************************************************************)
type error =
| Illegal_escape of char
| Unknown_error of exn
| Nothing_to_download
| Curl_error of int
| Unexpected_char of string * char * int * int
| Bad_marshalled_data of string
| Unknown_command of string
| Unknown_output_format of string
| Unknown_input_format of string
| Unexpected_expression of string
| Missing_configuration_file
| Error_in_configuration_file of string
| Missing_configuration_item of string
| Unknown_configuration_item of string
| Parsing_error of string * bool * int * int
| Template_not_found of string
| Dynlink_error of Dynlink.error (** The type of Ben-specific errors *)
exception Error of error
(** All Ben-specific errors are wrapped into this exception. *)
val string_of_error : error -> string
(** Return a human-readable explanation of an error. *)
val raise : error -> 'a
(** Wrapper around [Pervasives.raise] to raise a Ben exception. *)
val warn : error -> unit
(** Emit a warning. *)
val warn_exn : string -> exn -> unit
(** Emit a warning. *)
val error_exn : string -> exn -> unit
(** Emit an error. *)
|