Skip to content

Commit

Permalink
fix: add more logging on cli failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Kampfmoehre committed Sep 24, 2020
1 parent e6b729d commit 0d9e739
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ module.exports = async (pluginConfig, context) => {
stdio: "inherit",
});
} catch (err) {
throw new Error(`Unable to use Sentry CLI: ${err.message}`);
context.logger.error("fail", err);

if (pluginConfig.allowSentryFailure) {
context.logger.log(`Sentry publish failed, but this is allowed by config. Err: ${err.message}`);
return;
}

throw new SemanticReleaseError(`Unable to use Sentry CLI: ${err.message}`, "ESENTRYCLIFAILURE", err);
}
};
2 changes: 2 additions & 0 deletions lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module.exports = async (pluginConfig, context) => {
stdio: "inherit",
});
} catch (err) {
context.logger.error("fail", err);

if (pluginConfig.allowSentryFailure) {
context.logger.log(`Sentry verify failed, but this is allowed by config. Err: ${err.message}`);
return;
Expand Down
2 changes: 2 additions & 0 deletions lib/success.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module.exports = async (pluginConfig, context) => {
stdio: "inherit",
});
} catch (err) {
context.logger.error("fail", err);

if (pluginConfig.allowSentryFailure) {
context.logger.log(`Sentry success/finalize failed, but this is allowed by config. Err: ${err.message}`);
return;
Expand Down

0 comments on commit 0d9e739

Please sign in to comment.