Tell the user if the mal api refuses to answer

This commit is contained in:
Runebaas 2019-03-03 21:14:17 -05:00
parent c1ff11ca34
commit 7dbb2ab89f
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6

View file

@ -1,6 +1,7 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web; using System.Web;
using System.Xml;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.net.Lib.Clients; using Geekbot.net.Lib.Clients;
@ -62,6 +63,10 @@ namespace Geekbot.net.Commands.Integrations
"Unfortunally i'm not connected to MyAnimeList.net, please tell my senpai to connect me"); "Unfortunally i'm not connected to MyAnimeList.net, please tell my senpai to connect me");
} }
} }
catch (XmlException e)
{
await _errorHandler.HandleCommandException(e, Context, "The MyAnimeList.net API refused to answer");
}
catch (Exception e) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await _errorHandler.HandleCommandException(e, Context);
@ -110,6 +115,10 @@ namespace Geekbot.net.Commands.Integrations
"Unfortunally i'm not connected to MyAnimeList.net, please tell my senpai to connect me"); "Unfortunally i'm not connected to MyAnimeList.net, please tell my senpai to connect me");
} }
} }
catch (XmlException e)
{
await _errorHandler.HandleCommandException(e, Context, "The MyAnimeList.net API refused to answer");
}
catch (Exception e) catch (Exception e)
{ {
await _errorHandler.HandleCommandException(e, Context); await _errorHandler.HandleCommandException(e, Context);