BigcommerceException Class
The exception that is generated when BigCommerce returns an error.
The following example generates a
BigcommerceException due to a non-existing table, and then displays the exception.
public void ThrowBigcommerceException()
{
string mySelectQuery = "SELECT * FROM NONEXISTINGTABLE";
BigcommerceConnection bigcommerceConnection =
new BigcommerceConnection(
"Server=https://bigcommerce-store.mybigcommerce.com/api/v2/;User Id=User;Authentication Token=qweASDzcx1234567890rtyuiqweASDzcx1234567;");
BigcommerceCommand bigcommerceCommand = new BigcommerceCommand(mySelectQuery,bigcommerceConnection);
try
{
bigcommerceCommand.Connection.Open();
}
catch (BigcommerceException myException)
{
MessageBox.Show("Message: " + myException.Message + "\n");
}
}
Public Sub ThrowBigcommerceException()
Dim mySelectQuery As String = "SELECT * FROM NONEXISTINGTABLE"
Dim bigcommerceConnection As New BigcommerceConnection( _
"Server=https://bigcommerce-store.mybigcommerce.com/api/v2/;User Id=User;Authentication Token=qweASDzcx1234567890rtyuiqweASDzcx1234567;")
Dim bigcommerceCommand As New BigcommerceCommand(mySelectQuery, bigcommerceConnection)
Try
bigcommerceCommand.Connection.Open()
Catch myException As BigcommerceException
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