We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expected error.message to be of the form (as seen in node v14.17.6): Invalid URL: invalid-url.com
Invalid URL: invalid-url.com
We receive an error message: Invalid URL
Invalid URL
Without the URL included in the message
async function test () { const { default: got } = await import('got') return got.get('invalid-url.com') } function main () { return test() .then(res => { console.log(res) }) .catch(err => { console.log(err.message) }) } main()
The text was updated successfully, but these errors were encountered:
The URL should be available under error.input. This is actually a Node.js issue, Got doesn't modify URL error messages.
error.input
@sindresorhus Do we want to change this?
Sorry, something went wrong.
I think we should first try to get it fixed in Node.js
Found where the change was made - seems it was intentional and will not be getting "fixed" as such: https://github.com/nodejs/node/blob/75b68c6e4db515f76df73af476eccf382bbcb00a/lib/internal/errors.js#L1363
As well as the following PR that introduced it, so will close this unless it's within the mandate for got to alter the error at all.
Closing as the URL is available programmatically and the Node.js reasoning for hiding it makes sense.
No branches or pull requests
Describe the bug
Actual behavior
Expected error.message to be of the form (as seen in node v14.17.6):
Invalid URL: invalid-url.com
Expected behavior
We receive an error message:
Invalid URL
Without the URL included in the message
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: