-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hello, I was recently troubleshooting why an S800 scanner wasn't able to mount for use with our iOS application. The root cause appears to be that the app info being used is invalid, but in order to get that message I needed to edit capture.js inside of node_modules to see the error being thrown:
https://github.com/SocketMobile/socketmobile-capturejs/blob/main/lib/capture.js#L37
Just for the purposes of seeing if there was any additional error info in the response, I changed it to be:
.then(response => {
console.log(`SOCKET MOBILE RESPONSE: ${JSON.stringify(response)}`);
if (response.result && response.result.handle) {
this.clientOrDeviceHandle = response.result.handle;
return SktErrors.ESKT_NOERROR;
}
throw ({ error: new JRpcError(0, SktErrors.ESKT_COMMUNICATIONERROR, "There was an error during communication.") });
This worked. The shape of the response I received was:
{"jsonrpc":"2.0","error":{"code":-93,"message":"failed to open Capture"},"id":0}
Which gave me the error code, which then led me to ultimately find the ESKT_INVALIDAPPINFO error.
It looks like there may be an opportunity to pass back more specific errors here, rather than swallow the response and default to throwing a generic ESKT_COMMUNICATIONERROR if there is no result property on the response. It's possible I'm not familiar enough with if the shape of the response can be different so I may be off base, but I thought this was at least worth bringing up to consider.