123456789101112131415161718192021222324252627282930313233343536(*****************************************************************************)(* *)(* 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/. *)(* *)(*****************************************************************************)typet=|SqlErrorof{rc:Sqlite3.Rc.t;message:string}|LoadConfigErrorofSkhcConfig.Err.t|FileCreationofstring|Messageofstring|Exnofexnletsql_errorrcmessage=SqlError{rc;message}letsql_error'(rc,message)=sql_errorrcmessageletload_config_errors=LoadConfigErrorsletfile_creations=FileCreationsletmessagemsg=Messagemsgletmessage'fmt=Stdlib.Format.kasprintfmessagefmtletexnexn=Exnexnletto_string=function|SqlError{rc;message}->Printf.sprintf"SqlError: %s: %s"message(Sqlite3.Rc.to_stringrc)|LoadConfigErrors->Printf.sprintf"Cannot load config : %s"(SkhcConfig.Err.to_strings)|FileCreations->Printf.sprintf"Cannot create file or directory : %s"s|Messagemsg->msg|Exnexn->Printexc.to_stringexn