Closed fivdi closed 9 years ago
This will be a breaking change as Nan::ErrnoException
will be used for creating Error objects. The message property of Error objects created by Nan::ErrnoException
are prefixed with the appropriate code. For example, the message "Input/output error"
will become "EIO, Input/output error"
.
Implemented with https://github.com/fivdi/i2c-bus/commit/718f6f62e76c706143de05aae48b74a81022616a and published in v1.0.0.
Currently Error objects generated by i2c-bus only contain a message property. This can result in code that needs to examine the message strings in order to determine what to do. Code like this:
and this:
Error objects should contain message, errno, code, and syscall properties in order to make it possible to write code like this:
and this: