From: ole1986 Date: Thu, 14 Aug 2014 08:16:56 +0000 (+0200) Subject: improved error handling on ADDPRODUCT X-Git-Tag: 2.18~10^2~2 X-Git-Url: http://git.osdn.net/view?p=radegast%2Fradegast.git;a=commitdiff_plain;h=a35c351f39e076189997f7868cab81aa0ec43b47 improved error handling on ADDPRODUCT --- diff --git a/plugins/Radegast.Plugin.EVOVend/EVOvendPlugin.cs b/plugins/Radegast.Plugin.EVOVend/EVOvendPlugin.cs index ac46614..0e08253 100644 --- a/plugins/Radegast.Plugin.EVOVend/EVOvendPlugin.cs +++ b/plugins/Radegast.Plugin.EVOVend/EVOvendPlugin.cs @@ -113,13 +113,15 @@ namespace Radegast.Plugin.EVOVend param.Add("texture", ""); param.Add("botUUID", client.Self.AgentID.ToString()); string str = this.RequestVendor("ADDPRODUCT", param); - int result = Int32.Parse(str); + int result; + + Int32.TryParse(str, out result); if(result > 0){ instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Product " + e.Item.Name + " from Agent " + offeredAgent.ToString() + " accepted and inserted", ChatBufferTextStyle.StatusBlue); - client.Self.InstantMessage(offeredAgent, "Your Object has been transfered successfully. Please visit " + this.loginURL + " for further steps"); + client.Self.InstantMessage(offeredAgent, "Your Object has been transfered successfully. Please visit " + this.loginURL + " for further steps"); } else - instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Failed to insert " + e.Item.Name + " from Agent " + offeredAgent.ToString(), ChatBufferTextStyle.Error); + instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": ADDPRODUCT FAILED: "+str+" [ITEM: " + e.Item.Name + " AGENT: " + offeredAgent.ToString() + "]", ChatBufferTextStyle.Error); offeredAgent = UUID.Zero; }