Skip to content

urlapi: provide more detailed return codes - #8049

Merged
bagder merged 1 commit into
masterfrom
bagder/urlapi-returncodes
Nov 25, 2021
Merged

bagder merged 1 commit into
masterfrom
bagder/urlapi-returncodes

Conversation

@bagder

@bagder bagder commented Nov 23, 2021

Copy link
Copy Markdown
Member

Previously, the return code CURLUE_MALFORMED_INPUT was used for almost
30 different URL format violations. This made it hard for users to
understand why a particular URL was not acceptable. Since the API cannot
point out a specific position within the URL for the problem, this now
instead introduces a number of additional and more fine-grained error
codes to allow the API to return more exactly in what "part" or section
of the URL a problem was detected.

Also bug-fixes curl_url_get() with CURLUPART_ZONEID, which previously
returned CURLUE_OK even if no zoneid existed.

Test cases in 1560 have been adjusted and extended. Tests 1538 and 1559
have been updated.

Updated libcurl-errors.3 and curl_url_strerror() accordingly.

Previously, the return code CURLUE_MALFORMED_INPUT was used for almost
30 different URL format violations. This made it hard for users to
understand why a particular URL was not acceptable. Since the API cannot
point out a specific position within the URL for the problem, this now
instead introduces a number of additional and more fine-grained error
codes to allow the API to return more exactly in what "part" or section
of the URL a problem was detected.

Also bug-fixes curl_url_get() with CURLUPART_ZONEID, which previously
returned CURLUE_OK even if no zoneid existed.

Test cases in 1560 have been adjusted and extended. Tests 1538 and 1559
have been updated.

Updated libcurl-errors.3 and curl_url_strerror() accordingly.

Closes #8049
@bagder
bagder force-pushed the bagder/urlapi-returncodes branch from 1dd868f to 4183b8f Compare November 25, 2021 07:36
@bagder bagder closed this in 4183b8f Nov 25, 2021
@bagder
bagder merged commit 4183b8f into master Nov 25, 2021
@bagder
bagder deleted the bagder/urlapi-returncodes branch November 25, 2021 11:54
vszakats added a commit to vszakats/curl that referenced this pull request Jun 6, 2026
vszakats added a commit that referenced this pull request Jun 7, 2026
Detected by GitHub Code Quality

Follow-up to acd82c8 #11006
Follow-up to 4183b8f #8049

Closes #21879
dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Jun 9, 2026
Detected by GitHub Code Quality

Follow-up to acd82c8 curl#11006
Follow-up to 4183b8f curl#8049

Closes curl#21879
dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Jun 10, 2026
Detected by GitHub Code Quality

Follow-up to acd82c8 curl#11006
Follow-up to 4183b8f curl#8049

Closes curl#21879
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant