error throw here: in SDK
public Task<IEnumerable<DymoSDK.Interfaces.IPrinter>> GetPrinters()
{
List<Printer> list = new List<Printer>();
try
{
RefreshPrinters();
if (_printFactInstance?.Printers != null)
{
foreach (DYMO.LabelAPI.Interfaces.IPrinter printer in _printFactInstance.Printers)
{
if (list.FirstOrDefault((Printer f) => f.Name == printer.Name) != null)
{
continue;
}
bool isConnected = false;
bool isLocal = false;
if (Environment.OSVersion.VersionString.Contains("Windows"))
{
isConnected = SdkPrinterStatusHelper.CheckPrinterIsConnected(printer.Name);
isLocal = !SdkPrinterStatusHelper.CheckPrinterIsNetwork(printer.Name);
}
else
{
SdkPrinter sdkPrinterForMac = GetSdkPrinterForMac(printer.Name);
if (sdkPrinterForMac != null)
{
isConnected = SdkPrinterStatusHelper.CheckPrinterIsConnected(sdkPrinterForMac);
isLocal = !SdkPrinterStatusHelper.CheckPrinterIsNetwork(sdkPrinterForMac);
}
}
list.Add(new Printer
{
Name = printer.Name,
DriverName = printer.DriverName,
IsTwinTurbo = (printer.PrinterCommunication is IRollSelection),
IsLocal = isLocal,
IsAutoCutSupported = printer.IsAutoCutterSupported(),
IsConnected = isConnected,
PrinterType = ((printer.PrinterFamily == EPrinterFamily.LabelManager || printer.DriverName.Contains("DUO Tape")) ? "TapePrinter" : "LabelWriterPrinter")
});
}
}
}
catch (Exception ex)
{
SaveLog("Error getting printers: " + ex.ToString());
throw new Exception("Error getting printers", ex);
}
_printersModelList = list;
return Task.FromResult((IEnumerable<DymoSDK.Interfaces.IPrinter>)list);
}