Error objects in W3C APIs

Oliver Hunt oliver at apple.com
Wed Feb 5 11:23:50 PST 2014


On Feb 5, 2014, at 12:05 AM, Jonas Sicking <jonas at sicking.cc> wrote:

> On Tue, Feb 4, 2014 at 9:49 AM, Domenic Denicola
> <domenic at domenicdenicola.com> wrote:
>> From: es-discuss <es-discuss-bounces at mozilla.org> on behalf of Allen Wirfs-Brock <allen at wirfs-brock.com>
>> 
>>> I've designed exception handling systems before and designed and worked with complex exception hierarchies. My main caveat is that they are somewhat of an attractive nuisance.  It's easy to get into designing  beautiful classification hierarchies of dozens of different kinds of exceptions, each with their own specific failure information that is captured. In practice, I've found very little actual utility for them.
>> 
>> My (more limited) experience is the same.
> 
> I agree. Creating hierarchies of error "types" seems fragile to me.
> 

The other problem (an extension of “fragile”) is error objects when more than one global object/realm is involved.  Once you’re in that scenario type selection (e.g. making use of |instanceof|) can no longer be used in any meaningful way.

—Oliver



More information about the es-discuss mailing list