Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

Improve usefulness of error logging#8

Merged
tkadlec merged 5 commits intocatchpoint:maincatchpoint/WebPageTest.github-action:mainfrom
dovidgef:maindovidgef/webpagetest-github-action:mainCopy head branch name to clipboard
Feb 7, 2022
Merged

Improve usefulness of error logging#8
tkadlec merged 5 commits intocatchpoint:maincatchpoint/WebPageTest.github-action:mainfrom
dovidgef:maindovidgef/webpagetest-github-action:mainCopy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.