I've created a gateway which receives a POST from cUrl on one system which is a well-formed XML string. After processing the gateway sends back a response XML. All the fields in the XML are required and while the system sending the data constructs the XML itself I'm running some validation to make sure that every value that's being stored in the Request Class is actually.
One thing my gateway does is that the response can also indicate an error and sends a message and response code which is then displaced on the system as the following message:
An unknown error occurred while processing. Code: # Message: ERROR_MESSAGE
The original code just sends Code as 0 if there was no error or 1 if there was. I'm thinking of giving Code another value depending on the error since displaying Code in the error message is kinda useless if it's only ever going to be 1 (since you'll never see 0). So I'm wondering if there is a standard for creating error codes, particularly with PHP and XML.