Skip to content

Commit

Permalink
fix(release): improve error handling for npm publish (#26159)
Browse files Browse the repository at this point in the history
  • Loading branch information
vensller authored May 29, 2024
1 parent 52d04d9 commit 6d0bbee
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,22 @@ export default async function runExecutor(
const stdoutData = JSON.parse(err.stdout?.toString() || '{}');

console.error('npm publish error:');
if (stdoutData.error.summary) {
if (stdoutData.error?.summary) {
console.error(stdoutData.error.summary);
}
if (stdoutData.error.detail) {
if (stdoutData.error?.detail) {
console.error(stdoutData.error.detail);
}

if (context.isVerbose) {
console.error('npm publish stdout:');
console.error(JSON.stringify(stdoutData, null, 2));
}

if (!stdoutData.error) {
throw err;
}

return {
success: false,
};
Expand Down

0 comments on commit 6d0bbee

Please sign in to comment.