OkHttp Dispatcher Exception
UndyingSoul opened this issue ยท 3 comments
An exception is thrown when the DNS server fails to resolve discordapp.com.
Location: github.scarsz.discordsrv.DiscordSRV$2.lookupPublic(DiscordSRV.java:409)
[Debug Log](https://bin.scarsz.me/c9a788e5-384a-44d7-b0e4-
360d924fdb8e#H53h0Dm0KgkbsPj8pbqcwhQGlef1PImr.)
It should be relatively easy to fix, just need to catch the exception.
your dns/network doesn't work
[14:17:57] [OkHttp https://discordapp.com/.../ERROR]: [DiscordSRV] System DNS FAILED to resolve hostname discordapp.com, using fallback DNS servers!
[14:18:07] [OkHttp https://discordapp.com/.../ERROR]: [DiscordSRV] DNS server 1.1.1.1 failed to resolve discordapp.com: Receive timed out, connect timed out
I know, I pieced that together from what the error said. It just generated a stack trace in the console as if the exception wasn't handled, even though it's not a critical error. In my opinion, all it should display in the console is that the DNS server failed to resolve discordapp.com and that it'll try again in 30 seconds instead of generating a stack trace as well. If this was intended, then it's all good and you don't have to worry about anyone else getting issue #666.
What I expected to happen if DNS server lookup failed:
- Log to the console that the primary DNS lookup failed
- Try secondary DNS lookup
- If secondary lookup failed, log to console.
- Try again in x number of seconds
- If it fails again, try again in x*2 seconds.
- If that fails, the plugin should assume it cannot resolve the domain and disable itself (or handle it differently).
That particular stack trace actually seems to be #609, after a bit of a closer peek (exception class name + message weren't shown in the debug), and has already been fixed in development builds