1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2021 Nomadic Labs <contact@nomadic-labs.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)typeerror+=Cannot_open_context_indexof{context_path:string}typeerror+=Node_connection_losttypeerror+=Cannot_load_local_fileofstringletmake_idid=String.concat"."[Protocol.name;id]let()=Error_monad.register_error_kind`Temporary~id:(make_id"cannot_open_context_index")~title:"Cannot open context index"~description:"Failed to open the context index at the given location"~pp:(funfmtpath->Format.fprintffmt"Cannot open context index at %s"path)Data_encoding.(obj1(req"cannot_open_context_index"Data_encoding.string))(function|Cannot_open_context_index{context_path}->Somecontext_path|_->None)(funcontext_path->Cannot_open_context_index{context_path});register_error_kind`Temporary~id:(make_id"baking_scheduling.node_connection_lost")~title:"Node connection lost"~description:"The connection with the node was lost."~pp:(funfmt()->Format.fprintffmt"Lost connection with the node")Data_encoding.empty(functionNode_connection_lost->Some()|_->None)(fun()->Node_connection_lost);register_error_kind`Temporary~id:(make_id"baking_scheduling.cannot_load_local_file")~title:"Cannot load local file"~description:"Cannot load local file."~pp:(funfmtfilename->Format.fprintffmt"Cannot load the local file %s"filename)Data_encoding.(obj1(req"file"string))(functionCannot_load_local_files->Somes|_->None)(funs->Cannot_load_local_files)