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 usefulness of error logging #8

Merged
merged 5 commits into from
Feb 7, 2022
Merged

Conversation

dovidgef
Copy link
Contributor

@dovidgef dovidgef commented Jan 18, 2022

While using this Action many times we received generic errors like:

Error: Action failed with error [object Object]

This PR logs the actual error message from the Error object allowing users to see more helpful error messages.

The error messages now look like:

Error: Action failed with error: The test request will exceed the remaining test balance for the given API key

@dovidgef
Copy link
Contributor Author

Hi @tkadlec,
I would appreciate it if you could review my PR.

There is one point that I need clarification on, does the property statusText always exist on the Error object?
If not then I can switch back to using JSON.stringify(e) instead.

Thanks

@tkadlec
Copy link
Contributor

tkadlec commented Jan 24, 2022

This is looking great so far @dovidgef!

There is one point that I need clarification on, does the property statusText always exist on the Error object? If not then I can switch back to using JSON.stringify(e) instead.

In theory, yes. Might be good to add a quick check here, just to be extra resilient.

@dovidgef
Copy link
Contributor Author

@tkadlec I added a fallback to JSON.stringify() when statusText is undefined.

@dovidgef
Copy link
Contributor Author

@tkadlec anything else needed to get this merged?

Thanks

@tkadlec tkadlec merged commit f61def5 into catchpoint:main Feb 7, 2022
@tkadlec
Copy link
Contributor

tkadlec commented Feb 7, 2022

Appreciate your patience on this @dovidgef! Looks great...merged!

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.

3 participants