ExactTargetException Class
The exception that is generated when Salesforce Marketing Cloud returns an error.
The following example generates a
ExactTargetException due to a non-existing table, and then displays the exception.
|
|---|
public void ThrowExactTargetException()
{
string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
ExactTargetConnection exactTargetConnection =
new ExactTargetConnection(
"user=MyCompanyAdmin;password=mypassword;url=https://webservice.s7.exacttarget.com/Service.asmx;");
ExactTargetCommand exactTargetCommand = new ExactTargetCommand(mySelectQuery,exactTargetConnection);
try
{
exactTargetCommand.Connection.Open();
}
catch (ExactTargetException myException)
{
MessageBox.Show("Message: " + myException.Message + "\n");
}
} |
|
|---|
Public Sub ThrowExactTargetException()
Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
Dim exactTargetConnection As New ExactTargetConnection( _
"user=MyCompanyAdmin;password=mypassword;url=https://webservice.s7.exacttarget.com/Service.asmx;")
Dim exactTargetCommand As New ExactTargetCommand(mySelectQuery, exactTargetConnection)
Try
exactTargetCommand.Connection.Open()
Catch myException As ExactTargetException
MessageBox.Show("Message: " + myException.Message + ControlChars.Cr)
End Try
End Sub |