Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Linq;
using System.Threading;
using Utility;
using DCL.Diagnostics;

namespace DCL.Chat.MessageBus
{
Expand Down Expand Up @@ -69,7 +70,11 @@ private async UniTaskVoid HandleChatCommandAsync(ChatChannel.ChannelId channelId
string response = await command.ExecuteCommandAsync(parameters, commandCts.Token);
SendFromSystem(channelId, channelType, response);
}
catch (Exception) { SendFromSystem(channelId, channelType, "πŸ”΄ Error running command."); }
catch (Exception e)
{
SendFromSystem(channelId, channelType, "πŸ”΄ Error running command.");
ReportHub.LogError(ReportCategory.UNSPECIFIED, $"Error running command: {e}");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per CLAUDE.md Β§9, exceptions should be reported via ReportHub.LogException (not LogError with a string). LogException preserves structured exception data in the diagnostics system.

Also, OperationCanceledException should not be logged as an error β€” it's expected when commandCts.SafeRestart() cancels an in-flight command.

Suggested change
ReportHub.LogError(ReportCategory.UNSPECIFIED, $"Error running command: {e}");
ReportHub.LogException(e, new ReportData(ReportCategory.UNSPECIFIED));

And add a guard to the catch clause:

catch (Exception e) when (e is not OperationCanceledException)

}

return;
}
Expand Down
Loading