This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Error codes

Is there an error code range reserved for user application errors?

I wish to return application specific errors without defining a new error type, to maintain a unified approach to error handling.

Parents
  • As far as I know we do not have a specific range that is reserved for user-specific errors. However, you can add your own range.

    The SDK has an error code scheme which is defined in sdk_errors.h:which designates the lower 2 bytes to the actual error code, and the upper 2 bytes to indicate the source of the error.

    I suggest you use the range 0xF000-0xFFF0 for lower bytes and 0x8000-0xEFFF for upper bytes for user specific purposes.

    -Bjørn

Reply
  • As far as I know we do not have a specific range that is reserved for user-specific errors. However, you can add your own range.

    The SDK has an error code scheme which is defined in sdk_errors.h:which designates the lower 2 bytes to the actual error code, and the upper 2 bytes to indicate the source of the error.

    I suggest you use the range 0xF000-0xFFF0 for lower bytes and 0x8000-0xEFFF for upper bytes for user specific purposes.

    -Bjørn

Children
Related