fix(ng-dev/release): make package deprecation errors non-fatal#3660
Conversation
Catches and logs errors that occur during `npm deprecate` rather than allowing them to bubble up and cause the release process to fail. This serves as a temporary workaround for issues where package deprecation requests might fail unexpectedly.
josephperrott
left a comment
There was a problem hiding this comment.
LGTM
Your call on the comment I left, mostly just want to make sure we notice that a package failed to deprecate since it seems intermittent currently.
There was a problem hiding this comment.
Code Review
This pull request introduces error handling for the npm deprecation command by wrapping the execution in a try-catch block and logging any encountered errors. Feedback suggests improving the log output by displaying the summary message before the detailed error, including the package version for better context, and verifying the existence of the error object before logging.
| Log.error(e); | ||
| Log.error(` ✘ An error occurred while deprecating "${packageName}".`); |
There was a problem hiding this comment.
It is recommended to log the summary error message before the detailed log output to improve readability for the user. Additionally, including the package version in the summary helps identify which specific version failed when multiple deprecations are performed in sequence. Finally, checking if the error output exists avoids logging empty lines when a command fails without producing output.
Log.error(" ✘ An error occurred while deprecating \"" + packageName + "@" + version + "\".");
if (e) {
Log.error(e);
}Co-authored-by: Joey Perrott <josephperrott@gmail.com> Signed-off-by: Alan Agius <alan.agius4@gmail.com>
e4539ed to
28c12b2
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Catches and logs errors that occur during
npm deprecaterather than allowing them to bubble up and cause the release process to fail. This serves as a temporary workaround for issues where package deprecation requests might fail unexpectedly.