From dc469f9aaf0d5b77458e40893d897de12339b9b3 Mon Sep 17 00:00:00 2001 From: Tej Chajed Date: Sat, 9 Apr 2016 12:46:40 -0400 Subject: Print magic numbers in bad magic error message --- lib/system.mli | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/system.mli') diff --git a/lib/system.mli b/lib/system.mli index 062c8ea856..fa675a4f02 100644 --- a/lib/system.mli +++ b/lib/system.mli @@ -34,9 +34,11 @@ val file_exists_respecting_case : string -> string -> bool (** {6 I/O functions } *) (** Generic input and output functions, parameterized by a magic number and a suffix. The intern functions raise the exception [Bad_magic_number] - when the check fails, with the full file name. *) + when the check fails, with the full file name and expected/observed magic + numbers. *) -exception Bad_magic_number of string +type magic_number_error = {filename: string; actual: int; expected: int} +exception Bad_magic_number of magic_number_error val raw_extern_state : int -> string -> out_channel -- cgit v1.2.3