mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 10:57:17 +00:00
610 B
610 B
| id | title |
|---|---|
| guide-errors | Error Handling |
All functions in Node-Serialport follow two conventions:
- Argument errors throw a
TypeErrorobject. You'll see these when functions are called with invalid arguments. - Runtime errors provide
Errorobjects to the function's callback or emit anerror eventif no callback is provided. You'll see these when a runtime error occurs, like trying to open a bad port or setting an unsupported baud rate.
You should never have to wrap a Node-Serialport object in a try/catch statement if you call the functions with the correct arguments.