Re: [whatwg/webidl] What to do about specs that need lots of error types (Issue #1219)

But when you don't have shared error handling logic among **all** errors of a given specialised error class then this two-layered approach is a hindrance instead of an asset.

The benefit I see in having a specialised error class is not polluting the DOMException.name namespace, at the cost of a more complex error type (with inheritance and two members, "name" and "responseCode"), which inevitably leads into a two-layered error handling logic (again, more complexity). That assuming this "namespace pollution" is a problem in the first place.

If all smartcard-specific errors were also represented via specific DOMException.name values, one could for instance have a single map from DOMException.name value to error handling function. And that also wouldn't impede one from sharing code between error cases when appropriate. This looks better to me.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1219#issuecomment-1359131354
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1219/1359131354@github.com>

Received on Tuesday, 20 December 2022 10:19:03 UTC