mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 00:19:00 +03:00
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
This commit is contained in:
parent
844615e8bf
commit
c2f7aadaea
1 changed files with 1 additions and 2 deletions
|
@ -1,5 +1,4 @@
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Remora.Discord.Commands.Extensions;
|
|
||||||
using Remora.Results;
|
using Remora.Results;
|
||||||
|
|
||||||
namespace Octobot.Extensions;
|
namespace Octobot.Extensions;
|
||||||
|
@ -19,7 +18,7 @@ public static class LoggerExtensions
|
||||||
/// <param name="message">The message to use if this result has failed.</param>
|
/// <param name="message">The message to use if this result has failed.</param>
|
||||||
public static void LogResult(this ILogger logger, IResult result, string? message = "")
|
public static void LogResult(this ILogger logger, IResult result, string? message = "")
|
||||||
{
|
{
|
||||||
if (result.IsSuccess || result.Error.IsUserOrEnvironmentError())
|
if (result.IsSuccess)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue