In my device code I'm calling the telnet connect method which generates an error if the connection to the telnet server cannot be made.
I can use try/catch in the device code and it works as expected.
But, instead, if I put the try/catch in the app, which invokes the device method, which invokes the telnet connect method, the error appears in the log but the exception doesn't seem to "percolate" back up to the app.
Correct, as the App and Device/Driver have separate execution contexts, the typical expectation of being able to catch an exception at a higher layer does not work here.
Best option for such a case would be to put the try/catch in the driver, and in the catch clause, you can return a specific value to indicate the error, or even the exception message itself.