Dear All,

the following section of the manual contains the error codes that Stata may issue:
https://www.stata.com/manuals/perror.pdf

It is apparently incomplete, as errors in the 5000+ range seem to be related to Java interaction:
Code:
. error 5001
unable to allocate memory for Java virtual machine
r(5001);

. error 5002
failure to dynamically load Java runtime library
r(5002);

. error 5003
unable to create Java virtual machine
r(5003);
1. Is it possible to get an updated list of all defined error codes?
By "defined error code" I mean such a code #, that the command error # produces not just the r(#) message, but also an explanatory message of any kind. For example, error code 5003 is defined and 6003 is not defined according to this definition.

2. Is it possible [for Stata developers] to indicate a range for user error codes?
By "user error code" I mean such a code # , that no future Stata version will decorate with an explanatory message (or will not make a "defined error code" according to the above definition).

The reason for request #2 is that I had an archaic code which used to signal errors in the 5000+ range with own messages, such as
Code:
display as error "Error! Parameter 'a' may not be larger than the sum of 'b' and 'c'"
error 5001
which worked fine in Stata 8/9, but is now decorated with the totally confusing "unable to allocate memory for Java virtual machine" message.

Thank you, Sergiy