Channel.GetMessage 404
See original GitHub issueIf you try to get a message that has previously been deleted, but you have a stored ID for it, the Channel.GetMessage(ulong id);
method will crash and as far as i can tell swallow the exception.
I’m not entirely sure that this is true, since i’m executing the Channel.GetMessage(...);
function inside of the DiscordClient.LoggedIn
event, and i cannot get anything from the exception details due to the Exception occuring in a Task
The stacktrace i’m getting when using the DiscordConfigBuilder.LogHandler
event
Discord.Net.HttpException: The server responded with error 404 (NotFound)
at Discord.Net.Rest.RestSharpEngine.<Send>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Discord.Net.Rest.RestClient.<Send>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Discord.Net.Rest.RestClient.<Send>d__22`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Discord.Net.MessageQueue.<>c__DisplayClass19_0.<<RunEditQueue>b__0>d.MoveNext()
When trying to debug where the Exception even comes from, it leads to DiscordClient.ExecuteAndWait
, but encapsulating the contents of the Action
in a Try { } Catch(...) { }
doesn’t really present any new details.
tl;dr: It appears Channel.GetMessage()
swallows an exception and i want to be able to get it, or have null returned so that i can delete the stored message id from storage so that i don’t get errors every time it tries to access a dead message id.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
To clarify - this was part of a temporary workaround to deal with some issues related to the MessageQueue. GetMessage() in 1.0 will return null if a message doesn’t exist, as it used to pre-0.9.
This logic is currently being implemented into 1.0, see the /ref/ project on dev.