InterSystems FAQ rubric
To create a user-defined error you need to prepare the XML that describes the error code and corresponding message that you want to use as a user-defined error.
Please set the error code as a negative integer.
InterSystems Caché is a multi-model DBMS and application server. See more details here.