News for hackers. Stuff that matters.
Re:The problem with new URL(), and how URL.parse() fixes that by dllthomas on Wednesday May 22, 2024 @04:11PM (#40445793)
> forced to choose between "throws Exception" and a runtime exception,

Not that it fully defangs the issue, but there are two other options that come to mind.

1) suppress the exception (maybe with a log)

2) capture the fact (and maybe content) of the exception and expose it through the API in some other way

Probably neither of these is going to be appropriate for most cases, but seem worth surfacing because 1 is often chosen even when it's inappropriate and 2 is often overlooked as an option.

There are no comments on this comment yet.