Add COMMUNICATION_ERROR_CODE code to your client applications to gather communication error details.
public void Sync()
{
try
{
Product.Synchronize();
MessageBox.Show("Sync Done");
}
catch (SUPClientException ex)
{
if (ex.ErrorCode == SUPClientException.COMMUNICATION_ERROR)
{
COMMUNICATION_ERROR_CODE code = ex.CommunicationErrorCode;
if (code == COMMUNICATION_ERROR_CODE.SOCKET_HOST_NAME_NOT_FOUND)
{
MessageBox.Show("Server not found. Check host name.");
}
else if (code == COMMUNICATION_ERROR_CODE.CONNECT_TIMEOUT)
{
MessageBox.Show("Connection timed out. Try again later.");
}
else if (code == COMMUNICATION_ERROR_CODE.AUTHENTICATION_FAILED)
{
MessageBox.Show("Authentication failed. Check credentials.");
}
else
{
MessageBox.Show(code.ToString());
}
}
else
{
MessageBox.Show(ex.ToString());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}