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 |