From c2f7aadaeacdd1f0e88b6bc441f7783cac00ab07 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Sun, 24 Mar 2024 20:38:51 +0500 Subject: [PATCH] Do not use ResultError#IsUserOrEnvironmentError (#289) In LoggerExtensions#LogResult we skip logging the result if the error is "user or environment error". What matches that criteria is defined by Remora's implementation. However, none of errors defined by the implementation should *ever* happen or be ignored: * CommandNotFoundError: The client shouldn't send us non-existing commands. This *can* happen because the client's command list can get out of sync with the server's, but this happens rarely. * AmbiguousCommandInvocationError: We don't have commands that would trigger this error * RequiredParameterValueMissingError: The client shouldn't send us commands without required paremeters * ParameterParsingError: See #220 * ConditionNotSatisfiedError: The client shouldn't send us commands that don't satisfy our conditions Closes #220 --- src/Extensions/LoggerExtensions.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Extensions/LoggerExtensions.cs b/src/Extensions/LoggerExtensions.cs index 9df90b8..fca3702 100644 --- a/src/Extensions/LoggerExtensions.cs +++ b/src/Extensions/LoggerExtensions.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.Logging; -using Remora.Discord.Commands.Extensions; using Remora.Results; namespace Octobot.Extensions; @@ -19,7 +18,7 @@ public static class LoggerExtensions /// The message to use if this result has failed. public static void LogResult(this ILogger logger, IResult result, string? message = "") { - if (result.IsSuccess || result.Error.IsUserOrEnvironmentError()) + if (result.IsSuccess) { return; }