Skip to content

Conversation

TimWolla
Copy link
Member

@TimWolla TimWolla commented Sep 9, 2025

In case one of the other error codes is returned, treating it as a syntax error is going to be confusing for the user (and also the PHP team when an issue is reported).

…r_rfc3986

In case one of the other error codes is returned, treating it as a syntax error
is going to be confusing for the user (and also the PHP team when an issue is
reported).
@TimWolla TimWolla merged commit d2a54a0 into php:master Sep 9, 2025
9 checks passed
@TimWolla TimWolla deleted the uri-rfc3986-error-handling branch September 9, 2025 20:02
TimWolla added a commit to TimWolla/php-src that referenced this pull request Sep 15, 2025
This is a follow-up for php#19779 which updated the error *messages*
for the non-syntax errors, but did not update the exception class, still
implying it's related to invalid URIs.

Given that we don't know ourselves if these are reachable in practice, they are
cannot be meaningfully handled by a user of PHP. Thus this should be a `Error`
according to our exception policy.
TimWolla added a commit that referenced this pull request Sep 17, 2025
* uri: Add `UriError`

* uri: Throw `UriError` for unexpected failures in uri_parser_rfc3986

This is a follow-up for #19779 which updated the error *messages*
for the non-syntax errors, but did not update the exception class, still
implying it's related to invalid URIs.

Given that we don't know ourselves if these are reachable in practice, they are
cannot be meaningfully handled by a user of PHP. Thus this should be a `Error`
according to our exception policy.

* uri: Throw `UriError` when unable to recompose URIs

* uri: Throw `UriError` when unable to read component

* NEWS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants