Skip to content

ext-uri when to throw ValueError vs InvalidUriException #20366

@nyamsprod

Description

@nyamsprod

Description

The following code:

test

Resulted in this output:

Currently the tests returns a `ValueError`

But I expected this output instead:

Uri\WhatWg\InvalidUrlException: The specified URI is malformed; Invalid URL (DomainInvalidCodePoint)

To me both are acceptable, I would lean toward the second options which is what the WHATWG URL standard would expect but I understand the current output. I just want to know if there is a clear guideline when to throw a ValueError vs InvalidUrlException because from a DX usage it may mean that withers can only throw ValueError ? 🤔

PHP Version

using php master branch (but this is irrelevant)

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions