| 224 | } |
| 225 | |
| 226 | std::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, |
no outgoing calls
no test coverage detected