On Aug 12, 10:01 am, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
ISTM that the problem is not the slight discrepancy in the strings,
but their close ressemblance, assuming the two conditions that raised
the error ErrCode1 are different!
No actually the conditions are identical.
Actually, one problem is in the use of enums.
I don't see it that way.
I understand that for external references it might be useful to have
error codes, and that small integers might be practical for such error
codes. But internally, you shouldn't have to deal with them.
This particular mechanism is for a progromatic interface. Through a
published API a calling program has violated the contract. We are
returning the results. In this case the results will be formulated
into XML (not that it's terribly relevant).
<Result Status="Fail" ErrId="100">Reason for failure goes here</
Result>
The calling program can take corrective measures based on the
error code more easily than it can for text.
It can even more easily distinguish exception types. ;-)