Skip to content

Conversation

@cloutierMat
Copy link
Member

@cloutierMat cloutierMat commented Jun 25, 2025

This pr implements util.error and util.unauthorized. Along with an improvement on util.appendError to utilize LocalStack override of console to append errors to the context.

@cloutierMat cloutierMat marked this pull request as ready for review June 25, 2025 19:01
@cloutierMat cloutierMat requested a review from simonrw June 25, 2025 19:01
Copy link
Collaborator

@simonrw simonrw left a comment

Choose a reason for hiding this comment

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

Thanks for adding these crucial components to this package!

index.js Outdated
Comment on lines 136 to 137
// LocalStack is adding `appendError` to console, allowing to push errors to context.outErrors
console.appendError(error)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will impact users who want to use this package directly (outside of LocalStack 😱 ) right?

I guess the workaround is to add an appendError attribute to the console global in their own code, so perhaps this will encourage more people to use LocalStack!

Copy link
Member Author

Choose a reason for hiding this comment

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

Since it is inside a if block, the previous behaviour of console.error will apply when console.appendError is undefined. So it will still work as it previously did.

With that consideration in mind though, I will remove the TODO and leave a comment to explain.

@cloutierMat cloutierMat merged commit 282dd7d into main Jun 26, 2025
4 checks passed
@cloutierMat cloutierMat deleted the implement-error-and-unauthorized branch June 26, 2025 19:12
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