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
Enhanced CloudFormation error reporting with modern logs #10112
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10112 +/- ##
=======================================
Coverage 85.26% 85.26%
=======================================
Files 334 334
Lines 13638 13640 +2
=======================================
+ Hits 11628 11630 +2
Misses 2010 2010
Continue to review full report at Codecov.
|
lib/plugins/aws/lib/monitorStack.js
Outdated
@@ -133,7 +140,7 @@ module.exports = { | |||
}` | |||
); | |||
})(); | |||
throw new ServerlessError(errorMessage, errorCode); | |||
throw new ServerlessError(errorMessage, errorCode, decoratedErrorMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As passing inline optional arguments one by one, seems an anti-pattern, I would either support it as an option so:
new ServerlessError(errorMessage, errorCode, { decoratedErrorMessage })
or simply decorate error on spot:
throw Object.assign(new ServerlessError(errorMessage, errorCode), { decoratedErrorMessage) })
lib/plugins/aws/lib/monitorStack.js
Outdated
stackLatestError.LogicalResourceId | ||
} ${style.aside(`(${stackLatestError.ResourceType})`)}\n${ | ||
stackLatestError.ResourceStatusReason | ||
}\n\n${style.aside(`View the full error: ${stackUrl}`)}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll be nice to wrap url with style.link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see legacy.log
decorated with style.link
instead of decorated log :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, that's embarassing
I've fixed it
6f06c72
to
f03f846
Compare
f03f846
to
3785bc6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 👍
Addresses: #9860