summaryrefslogtreecommitdiff
path: root/parsing
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2013-09-12 14:34:13 +0000
committerAlain Frisch <alain@frisch.fr>2013-09-12 14:34:13 +0000
commit8660e346df9c4b9bb5db38d5c91689f8a6ad906c (patch)
tree6d829ecb9eba696a42d81dd44bd97117cba2bdd9 /parsing
parentbc9e5b0a5103724e6610a56898dd1b81528bec70 (diff)
downloadocaml-8660e346df9c4b9bb5db38d5c91689f8a6ad906c.tar.gz
Continue.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14119 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'parsing')
-rw-r--r--parsing/location.ml13
1 files changed, 13 insertions, 0 deletions
diff --git a/parsing/location.ml b/parsing/location.ml
index 63c2d04226..579c1dbefb 100644
--- a/parsing/location.ml
+++ b/parsing/location.ml
@@ -347,3 +347,16 @@ let error_of_printer loc print x =
let error_of_printer_file print x =
error_of_printer (in_file !input_name) print x
+
+let () =
+ register_error_of_exn
+ (function
+ | Sys_error msg ->
+ Some (errorf ~loc:(in_file !input_name) "Error: I/O error: %s" msg)
+ | Warnings.Errors n ->
+ Some
+ (errorf ~loc:(in_file !input_name)
+ "Error: Some fatal warnings were triggered (%d occurrences)" n)
+ | _ ->
+ None
+ )