Commits

Anonymous committed 58bb8c8

Add error_to_string.

  • Participants
  • Parent commits 3d47927

Comments (0)

Files changed (2)

     | X_field_bad_syntax of int * Cf_message.t
     | X_field_duplicated of string
 
+let error_to_string = function
+    | X_field_bad_syntax (n, _) ->
+        Printf.sprintf "field with bad syntax at line %u" n
+    | X_field_duplicated name ->
+        Printf.sprintf "duplicate '%s' field" name
+
 exception Error of error
 
 let split_at_body =

mime/mime_lex.mli

     | X_field_bad_syntax of int * Cf_message.t
     | X_field_duplicated of string
 
+val error_to_string: error -> string
+
 exception Error of error
 
 val split_at_body: Cf_message.t -> Cf_message.t * Cf_message.t