Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catching reading exception #2

Open
morgan-wild opened this issue Dec 11, 2021 · 0 comments
Open

Catching reading exception #2

morgan-wild opened this issue Dec 11, 2021 · 0 comments

Comments

@morgan-wild
Copy link

Thank you for your work!

You implemented the read loop, that is very helpful.

But in this loop, you catched the case the device is disconnected:

    catch (error) {
        console.error("Read Loop error. Have the serial device been disconnected ? ");
    }

So there is no way to us to know when this case happends. My proposal is to let an exception comes up or make a callback.

For example:

    catch (error) {
        throw 'Unable to read data from the device';
    }
archocron pushed a commit that referenced this issue Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant