Errors and Messages Recommendations

I am planning an EDI system that sends, among other things, an XML confirmation message containing several elements, but specifically these three; ErrorCode, ErrorSeverity and ErrorDescription.

Basically, I will parse the incoming XML message, and depending on the success or failure of the parsing, include message formatting, syntax, structure, validity, and some business rules. I will return either to success or to confirmation of failure.

I have fluency to select ErrorCodes, ErrorSeverity and ErrorDescription, but instead of naively starting with ErrorCode [1], ErrorSeverity [Error], ErrorDescription [Unable to find the incoming XML file] and add errors as I think of them in I was wondering if the encoding time in the parser for incoming messages was there any best practice for choosing error and severity codes?

I know that HTTP error codes are similar to 2xx for OK messages, 4xx for specific errors, 5xx for server errors, etc., and wondered if anyone has any good suggestions that could help me along the way. before I roll myself into a corner and say "if only all my" warning "errors started with 3 or something like that!

I think that ErrorSeverity will not be much larger than [Error], [Warning], [Info] and [OK], maybe?

Thanks.

+4
source share
2 answers

Here you can find existing error codes for EDI:

http://msdn.microsoft.com/en-us/library/bb245948.aspx

The systems / developers with whom you will communicate are likely to be pleased if you use one of the standards described in one of these documents.

+2
source

I like to distinguish "Error" (the original data was erroneous) from "Fatal" (the system is broken). The first requires fixing data and retrying; Do not have another one.

Of course, any error messages must be valid; they must clearly indicate to the recipient exactly what is wrong and what actions need to be taken to correct the data error.

If you separately report seriousness, then not only do I not see the need to adhere to predetermined numerical ranges, I believe that such a move is a straight jacket. If you decide to use the mnemonic when using ranges, make the ranges at least ten times bigger than you think you need (numbers are cheap, why not use five?) -

You can also consider parameterizing your messages; for example explicit fields to indicate a position in the text. This simplifies the code for receiving the message and does something useful with it (without the need to analyze human readable text looking for clues).

+1
source

All Articles