Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
472 stars 176 forks source link

Catch serial port connection error #344

Open neelizalde opened 2 months ago

neelizalde commented 2 months ago

I can`t catch the error emitted when is not connection with COM port. How can I do it?

Error:

triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: Opening COM4: File not found
Emitted 'error' event on SerialPort instance at:
    at SerialPort._error (C:\DEVOPS\01-08-2024-begitrack\BegiTrack\backend-electron\node_modules\@serialport\stream\dist\index.js:85:18)
    at C:\DEVOPS\01-08-2024-begitrack\BegiTrack\backend-electron\node_modules\@serialport\stream\dist\index.js:118:18
stefanpoeter commented 1 month ago

Try adding DEBUG=* as an Environment Variable and see what it spits out.