Improved error handling when QBW file does not exist or SDK not installed. BOD-142
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -25,6 +26,10 @@ namespace BodyshopPartner.Utils
|
||||
|
||||
public static void ConnectToQuickBooks()
|
||||
{
|
||||
if(String.IsNullOrWhiteSpace(Properties.Settings.Default.QuickBooksFilePath) || !File.Exists(Properties.Settings.Default.QuickBooksFilePath))
|
||||
{
|
||||
throw new Exception("The QuickBooks file specified does not exist.");
|
||||
}
|
||||
try
|
||||
{
|
||||
logger.Debug("Attempting to connect to QuickBooks...");
|
||||
@@ -58,6 +63,11 @@ namespace BodyshopPartner.Utils
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex);
|
||||
if(ex.Message.Contains("80040154 Class not registered"))
|
||||
{
|
||||
logger.Error("QuickBooks Request Processor not registered. Is QuickBooks installed on this computer?");
|
||||
throw new Exception("QuickBooks Request Processor not registered. Is QuickBooks installed on this computer?");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user