MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / TakeErrorMessage

Function TakeErrorMessage

src/PluginSegmentation.cpp:226–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226std::string TakeErrorMessage(const opencc_segmentation_plugin_v2* descriptor,
227 opencc_error_t* error,
228 const std::string& fallback) {
229 if (error == nullptr) {
230 return fallback;
231 }
232 const std::string message =
233 error->message == nullptr ? fallback : std::string(error->message);
234 if (descriptor->free_error != nullptr) {
235 descriptor->free_error(error);
236 }
237 return message;
238}
239
240[[noreturn]] void ThrowPluginError(const opencc_segmentation_plugin_v2* descriptor,
241 opencc_error_t* error,

Callers 2

ThrowPluginErrorFunction · 0.85
CreatePluginSegmentationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected