The exception that is generated when Mailchimp returns an error.
The following example generates a
MailChimpException due to a non-existing table, and then displays the exception.
public void ThrowMailChimpException()
{
string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
MailChimpConnection mailchimpConnection =
new MailChimpConnection(
"api key=8b10fe893c9732d12befe0b7d846ffcb-us10;");
MailChimpCommand mailchimpCommand = new MailChimpCommand(mySelectQuery,mailchimpConnection);
try
{
mailchimpCommand.Connection.Open();
}
catch (MailChimpException myException)
{
MessageBox.Show("Message: " + myException.Message + "\n");
}
}
Public Sub ThrowMailChimpException()
Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
Dim mailchimpConnection As New MailChimpConnection( _
"api key=8b10fe893c9732d12befe0b7d846ffcb-us10;")
Dim mailchimpCommand As New MailChimpCommand(mySelectQuery, mailchimpConnection)
Try
mailchimpCommand.Connection.Open()
Catch myException As MailChimpException
MessageBox.Show("Message: " + myException.Message + ControlChars.Cr)
End Try
End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2