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 |