Core: log reply attempts and surface send failures
Log every command reply (target + size, debug) and warn when the plugin's sendTextMessage returns an error instead of silently discarding it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
5796ccbc74
commit
352101e657
1 file changed
+15
-1
+15
-1
@@ -1246,9 +1246,23 @@ namespace Echoion::Core
|
|||||||
// Create reply callback
|
// Create reply callback
|
||||||
auto replyFunc = [this](uint64_t clientId,
|
auto replyFunc = [this](uint64_t clientId,
|
||||||
std::string_view message) {
|
std::string_view message) {
|
||||||
|
Void::Log::debug(
|
||||||
|
"Core", "{}",
|
||||||
|
std::format("Reply -> client {} ({} bytes)",
|
||||||
|
clientId, message.size()));
|
||||||
if (pluginInterface_) {
|
if (pluginInterface_) {
|
||||||
pluginInterface_->sendTextMessage(
|
auto sent = pluginInterface_->sendTextMessage(
|
||||||
clientId, std::string(message));
|
clientId, std::string(message));
|
||||||
|
if (!sent) {
|
||||||
|
Void::Log::warn(
|
||||||
|
"Core", "{}",
|
||||||
|
std::format("Reply send failed: {}",
|
||||||
|
sent.error().message));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Void::Log::warn("Core", "{}",
|
||||||
|
"Reply dropped: no plugin "
|
||||||
|
"interface");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user