From 7dbb2ab89f86473766746613dcab5ad3e0b53d5b Mon Sep 17 00:00:00 2001 From: Runebaas Date: Sun, 3 Mar 2019 21:14:17 -0500 Subject: [PATCH] Tell the user if the mal api refuses to answer --- Geekbot.net/Commands/Integrations/Mal.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Geekbot.net/Commands/Integrations/Mal.cs b/Geekbot.net/Commands/Integrations/Mal.cs index 88f500e..1ad50bb 100644 --- a/Geekbot.net/Commands/Integrations/Mal.cs +++ b/Geekbot.net/Commands/Integrations/Mal.cs @@ -1,6 +1,7 @@ using System; using System.Threading.Tasks; using System.Web; +using System.Xml; using Discord; using Discord.Commands; 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"); } } + catch (XmlException e) + { + await _errorHandler.HandleCommandException(e, Context, "The MyAnimeList.net API refused to answer"); + } catch (Exception e) { 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"); } } + catch (XmlException e) + { + await _errorHandler.HandleCommandException(e, Context, "The MyAnimeList.net API refused to answer"); + } catch (Exception e) { await _errorHandler.HandleCommandException(e, Context);