ASException/DOMException/XPathException overlap is problematic

The similarity and overlap between ASException, XPathException and DOMException would appear to be problematic.  If a caller in a loosely-typed binding received an exception, it would be difficult to distinguish between the exceptions.

The overlap in symbolic names that I've noticed are:

ASException.INVALID_CHARACTER_ERR == DOMException.INVALID_CHARACTER_ERR == 5

ASException.VALIDATION_ERR == 6, DOMException.VALIDATION_ERR == 16

ASException.TYPE_ERR == 2, XPathException.TYPE_ERR == 2

The overlap of code values would seem to be totally avoidable,  there is not a shortage of distinct integer values and it should be very easy just to assign, for example, XPathException.TYPE_ERR = 102, so that it will never be misinterpreted as a DOMException.DOMSTRING_SIZE_ERR.

Received on Saturday, 20 April 2002 15:34:20 UTC