Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ dmcs taxonomy.cs -r:System.Data.dll -r:System.Web.dll -r:../module/AlchemyAPI.dl

dmcs image.cs -r:System.Data.dll -r:System.Web.dll -r:../module/AlchemyAPI.dll

dmcs ranked_image_keywords.cs -r:System.Data.dll -r:System.Web.dll -r:../module/AlchemyAPI.dll
dmcs ranked_image_keywords.cs -r:System.Data.dll -r:System.Web.dll -r:../module/AlchemyAPI.dll -r:System.Drawing.dll

28 changes: 24 additions & 4 deletions module/AlchemyAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -955,8 +955,18 @@ private string DoRequest(HttpWebRequest wreq, AlchemyAPI_BaseParams.OutputMode o

if (status.InnerText != "OK")
{
System.ApplicationException ex =
new System.ApplicationException ("Error making API call.");
string errorMessage = "Error making API call.";

try
{
XmlNode statusInfo = root.SelectSingleNode("/results/statusInfo");
errorMessage = statusInfo.InnerText;
}
catch
{
errorMessage = "An error occurred: Unable to access XmlNode /results/statusInfo";
}
System.ApplicationException ex = new System.ApplicationException (errorMessage);

throw ex;
}
Expand All @@ -970,8 +980,18 @@ private string DoRequest(HttpWebRequest wreq, AlchemyAPI_BaseParams.OutputMode o

if (status.InnerText != "OK")
{
System.ApplicationException ex =
new System.ApplicationException ("Error making API call.");
string errorMessage = "Error making API call.";

try
{
XmlNode statusInfo = root.SelectSingleNode("/results/statusInfo");
errorMessage = statusInfo.InnerText;
}
catch
{
errorMessage = "An error occurred: Unable to access XmlNode /results/statusInfo";
}
System.ApplicationException ex = new System.ApplicationException (errorMessage);

throw ex;
}
Expand Down