-------------------------------------------------------------------------
| 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> |