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

improve error logging for JS/TS ping test #119

Conversation

GlenDC
Copy link
Contributor

@GlenDC GlenDC commented Jan 30, 2023

helps debugging issues in case
things go haywire while testing the JS implementation

helps debugging issues in case
things go haywire while testing the JS implementation
@MarcoPolo
Copy link
Contributor

Thanks. What errors did you run into that this logged?

If you have time, could you rebase to #121. If not, no worries. I can take :)

@GlenDC GlenDC changed the base branch from master to marco/update-tests-to-spec January 31, 2023 22:45
@GlenDC
Copy link
Contributor Author

GlenDC commented Jan 31, 2023

Thanks. What errors did you run into that this logged?

If you have time, could you rebase to #121. If not, no worries. I can take :)

Rebased it.

Two issues:

  1. fetch API that wasn't defined, which was a redis-proxy error that was previously silenced. Fix was to use node v18, but hard to know if I do not see the error
  2. second error was related to something going wrong in the Ping call, cannot remember exactly anymore what. Know it was an issue on my end as well. But that thing now just returns an AggregateError, which when logged just says that All promises got rejected. So not useful. Logging the errors itself does reveal it.

Comment on lines +104 to +107
console.error(`unexpected exception in ping test: ${err}\n Errors: ${err.errors}`)
} else {
console.error(`unexpected exception in ping test: ${err}`)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am no JS expert but I think if you pass the err as an argument to console.error, it will display a nice stacktrace.

Suggested change
console.error(`unexpected exception in ping test: ${err}\n Errors: ${err.errors}`)
} else {
console.error(`unexpected exception in ping test: ${err}`)
}
console.error(`unexpected exception in ping test: ${err}\n Errors: ${err.errors}`)
} else {
console.error(`unexpected exception in ping test`, err)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be. Feel free to take over this PR by the way @MarcoPolo. You probably know better what you want to do with this suggestion and PR. My intention was more to share the need for better error logging in case the happy path is not being followed.

@ddimaria
Copy link

ddimaria commented Feb 3, 2023

@GlenDC this PR has merge conflicts

@MarcoPolo
Copy link
Contributor

I'm taking this pr.

@MarcoPolo
Copy link
Contributor

Added logs to #121

@MarcoPolo MarcoPolo closed this Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants