Type guard for FrontPanelError: narrows a caught value to a rejected FrontPanel operation carrying an ErrorCode on errorCode. Prefer this over instanceof when handling errors from FrontPanel operations.
errorCode
instanceof
try { await device.getFPGAConfiguration().loadFromFile(bitfile);} catch (error) { if (isFrontPanelError(error) && error.errorCode === ErrorCode.Timeout) { // retry logic }} Copy
try { await device.getFPGAConfiguration().loadFromFile(bitfile);} catch (error) { if (isFrontPanelError(error) && error.errorCode === ErrorCode.Timeout) { // retry logic }}
Type guard for FrontPanelError: narrows a caught value to a rejected FrontPanel operation carrying an ErrorCode on
errorCode. Prefer this overinstanceofwhen handling errors from FrontPanel operations.