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

fix: include method and url in request error message #177

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

epeters3
Copy link
Contributor

@epeters3 epeters3 commented Aug 22, 2024

Sometimes I see errors like this in logs:

"Error: Request failed with status code 404
    at lambdaResponse (/node_modules/@lifeomic/alpha/lib/adapters/helpers/lambdaResponse.js:17:11)
    at <anonymous> (/node_modules/@lifeomic/alpha/lib/adapters/lambda-invocation.js:87:12)

These^ error messages don't give any info about which line threw the error, or what Lambda URL was being called. This change will make that error message look like Error: Request GET lambda://test-function/some/path failed with status code 400, which provides more helpful debug information.

default:
throw new Error(
'Unhandled responseType requested: ' + config.responseType,
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No functional changes here^, just Prettier.

@epeters3 epeters3 force-pushed the EOCI-117/improve-error-messages branch from a6ed600 to 5461b68 Compare August 22, 2024 17:24
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of these changes are Prettier. The only functional changes in this file are on line 213 and lines 240-254.

Copy link

@jkdowdle jkdowdle left a comment

Choose a reason for hiding this comment

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

I've seen this too and never considered it could be improved, this is great. thank you

@epeters3 epeters3 merged commit c0506de into master Aug 22, 2024
6 checks passed
@epeters3 epeters3 deleted the EOCI-117/improve-error-messages branch August 22, 2024 18:14
Copy link

🎉 This PR is included in version 6.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants