MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / CheckArgument

Function CheckArgument

Exporter/Plugin/ExporterPluginManager.cpp:125–155  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

123
124 //-------------------------------------------------------------------------
125 void
126 CheckArgument(const std::weak_ptr<LoadedPlugin<Plugin::IExportPlugin>>& weakPlugin,
127 const std::filesystem::path& pluginPath,
128 const std::optional<std::wstring>& parameter)
129 {
130 auto p = weakPlugin.lock();
131 if (!p)
132 THROW("Plugin was released");
133
134 std::string error;
135 try
136 {
137 p->Get().CheckArgument(parameter);
138 return;
139 }
140 catch (const Plugin::OptionsParserException&)
141 {
142 throw;
143 }
144 catch (const std::exception& e)
145 {
146 error = e.what();
147 }
148 catch (...)
149 {
150 error = "Unknow";
151 }
152
153 auto fullErrorMessage = InvalidPluginError("CheckArgument", error, pluginPath);
154 throw std::runtime_error(fullErrorMessage);
155 }
156
157 //-------------------------------------------------------------------------
158 std::vector<CppCoverage::ExportPluginDescription>

Callers 2

TEST_FFunction · 0.85

Calls 2

InvalidPluginErrorFunction · 0.85
CheckArgumentMethod · 0.45

Tested by 1

TEST_FFunction · 0.68