Skip to content
New issue

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

CLI: Bad error output for http #582

Open
josephjclark opened this issue Feb 1, 2024 · 1 comment · May be fixed by #583
Open

CLI: Bad error output for http #582

josephjclark opened this issue Feb 1, 2024 · 1 comment · May be fixed by #583

Comments

@josephjclark
Copy link
Collaborator

Experimenting with the CLI and this job:

get({ url: 'https://api.chucknorris.io/jokes/random' });

Gives terrible error output.

Here's the result in 5.04:
image

It is better in 6.0.0:

image

The error is expected btw - I'd just like to be able to see what it actually is.

@josephjclark
Copy link
Collaborator Author

I'm also seeing this on the next release branch:

[R/T] ✘ AdaptorError: [object Object]

What's going on here is:

  • The error is being thrown by tough-cookie deep inside http
  • Usually I am hiding stack traces because they're usually out of the user's hands. But it's VERY helpful to see the stack trace on this because I know which part of the adaptor code it comes from, which helps me diagnose the problem.
  • The underlying error is a tough-cookie ParameterError. We need to surface that error name, not show AdaptorError
  • The actual error message really does seem to be [Object object]. If I used tough-cookie in node and reproduced this, that's what I'd see. So we can't make that bit any better unfortunately.

Some concrete fixes then:

  • Include a stack trace in AdaptorErrors
  • Use the underlying Error type as the Adaptor Error name

@josephjclark josephjclark linked a pull request Feb 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

Successfully merging a pull request may close this issue.

1 participant