MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / load_module_error

Class load_module_error

include/chaiscript/language/chaiscript_common.hpp:137–164  ·  view source on GitHub ↗

\brief Thrown if an error occurs while attempting to load a binary module

Source from the content-addressed store, hash-verified

135 {
136 /// \brief Thrown if an error occurs while attempting to load a binary module
137 struct load_module_error : std::runtime_error
138 {
139 explicit load_module_error(const std::string &t_reason) noexcept
140 : std::runtime_error(t_reason)
141 {
142 }
143
144 load_module_error(const std::string &t_name, const std::vector<load_module_error> &t_errors)
145 : std::runtime_error(format_error(t_name, t_errors))
146 {
147 }
148
149 load_module_error(const load_module_error &) = default;
150 ~load_module_error() noexcept override = default;
151
152 static std::string format_error(const std::string &t_name, const std::vector<load_module_error> &t_errors)
153 {
154 std::stringstream ss;
155 ss << "Error loading module '" << t_name << "'\n"
156 << " The following locations were searched:\n";
157
158 for (const auto &err : t_errors) {
159 ss << " " << err.what() << "\n";
160 }
161
162 return ss.str();
163 }
164 };
165
166
167 /// Errors generated during parsing or evaluation

Callers 6

load_moduleMethod · 0.85
Loadable_ModuleMethod · 0.85
DLModuleMethod · 0.85
DLSymMethod · 0.85
DLModuleMethod · 0.85
DLSymMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected