aboutsummaryrefslogtreecommitdiff
path: root/src/errors.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors.ml')
-rw-r--r--src/errors.ml14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/errors.ml b/src/errors.ml
index f4b3425..e5abe10 100644
--- a/src/errors.ml
+++ b/src/errors.ml
@@ -20,12 +20,16 @@ along with licht. If not, see <http://www.gnu.org/licenses/>.
exception Undefined of UTF8.t * string list
exception TypeError
-
exception Cycle
let printf formatter = function
- | Undefined (name, args) -> Format.fprintf formatter
- "There is no function '%s' with signature %a"
+ | Undefined (name, args) ->
+ let pp_sep f () = Format.pp_print_string f ", " in
+ Format.fprintf formatter
+ "There is no function '%s' with signature (%a)"
(UTF8.to_utf8string name)
- (Format.pp_print_list Format.pp_print_text) args
- | _ -> Format.fprintf formatter "#Error"
+ (Format.pp_print_list ~pp_sep Format.pp_print_text) args
+ | Cycle -> Format.fprintf formatter "Cycle"
+ | TypeError -> Format.fprintf formatter "TypeError"
+ | Not_found -> Format.fprintf formatter "Not_found"
+ | _ -> Format.fprintf formatter "?"