Exceptions

The SDK provides the user a list of exceptions that they may use when calling any of the API's methods. This can come in handy when catching errors that will provide more details and that are specific to the Brady SDK.

SdkApiException

This is the base exception that will be extended by more specific exceptions (all listed below).

InvalidBarcodeData

Can be caught when a barcode in a template is not valid. A barcode object can be retrieved by using TemplateObjectData.

PrinterConnectionException

Can be caught when a connection error occurs when the connectedToDiscoveredPrinter method is called.

PrinterDiscoveryException

Can be caught when a discovery error occurs when the PrinterDiscoveryFactory.getPrinterDiscovery method is called.

PrintingException

Can be caught when a printing error occurs when the print method is called.

TemplateNotLoadedException

Can be caught when a template error occurs while calling on a Template object.

UnsupportedPrinterException

Can be caught when an unknown error occurs, but we know that it relates to the printer communication.