url icon indicating copy to clipboard operation
url copied to clipboard

Named validation errors

Open TRowbotham opened this issue 7 years ago • 3 comments

It would be neat if the URL parser had named validation errors like what was done for the HTML Tokenizer in whatwg/html#2701.

TRowbotham avatar Jul 27 '18 21:07 TRowbotham

FWIW, I'd be supportive of someone adding this to the standard and will happily help out with review.

annevk avatar May 05 '20 15:05 annevk

I have this mostly done. I'll try to finish it up and post something for review.

TRowbotham avatar May 06 '20 03:05 TRowbotham

My 2c: This is an excellent example of an issue for which my opinion changes depending on whether this is in the context of a spec for a data format (the URL string) or for an API (the web API exposed by browsers).

In any particular API, I think named errors are excellent, and I would support adding them to the web API. By contrast, it's not immediately clear to me that there would be value in trying to define these errors on the data format that is a URL string, as the exact manner of error handling is something typically left to an implementation decision, particularly given that error handling is often a context specific and language specific thing. For instance, error design for human consumption and for programmatic use often differ, and I think that the URL format should be agnostic to such concerns.

alercah avatar Sep 02 '22 12:09 alercah