Extending Error Codes


laczenJMS
 

Hello Zephyr Developers,

I recently had a request to change the error codes in a zephyr module
to use the standard supplied error codes. Doing so would reduce the
descriptiveness of the error codes so I did not really like this.
However in my module I was using error codes (-) 1 to 10, and I think
this was a bad idea. If someone needs to check the error code he/she
might end up looking at errno.h and finding a completely different
definition.

Would it not be a good idea to allow extending the standard error
codes with module (subsystem) specific error codes that can be as
descriptive as required by allowing modules to use error codes above a
specific value. E.g. any module can use it's own error codes starting
from 0x7F00 to 0x7FFF. This way it is possible to avoid overlap
between standard errors and "user" errors.

What's your opinion ?

Kind regards,

Jehudi

Join devel@lists.zephyrproject.org to automatically receive all group messages.