Custom Error Code
Custom Error Codes are set aside for use when an existing error code does not adequately describe the error condition. The developer can define custom error codes that are specific to the application. They do not need to conform to any other application.
Custom Error Code Ranges
Custom error codes can range from:
- -8999 through -8000
- 5000 through 9999
- 500,000 through 599,999.
Error Planning
Even though these codes are available to define custom errors, it is more important to provide a good explanation of the error and how to fix it rather than having unique error codes for every error. However, if the developer will use the error code to direct the response, display, or logging differently for different errors, than the error code could be necessary. It is often useful to define code bands during the project planning stage, setting aside bands for specific related error groups and/or error handling.