1234567891011121314151617181920212223242526272829303132333435(*****************************************************************************)(* *)(* Copyright (C) 2026 Yves Ndiaye *)(* *)(* This Source Code Form is subject to the terms of the Mozilla Public *)(* License, v. 2.0. If a copy of the MPL was not distributed with this *)(* file, You can obtain one at https://mozilla.org/MPL/2.0/. *)(* *)(*****************************************************************************)(** Operations on errors while parsing a configuration file. *)(** The type of errors appearing while parsing a configuration file. *)typet=|ParsingErrorofstring|MissingSectionofstring|MissingKeyofstring(** [parsing_error msg] creates a [ParsingError] error with [msg]. *)letparsing_errors=ParsingErrors(** [missing_section msg] creates a [MissingSection] error with [msg]. *)letmissing_sections=MissingSections(** [missing_key msg] create a [MissingKey] error with [msg] *)letmissing_keys=MissingKeys(** [to_string error] returns the string representation of [error]; *)letto_string=function|ParsingErrors->Printf.sprintf"parsing error : %s"s|MissingSectionmissing->Printf.sprintf"missing section : %s"missing|MissingKeykey->Printf.sprintf"key error : %s"key