Skip to content

Commit

Permalink
Throwing error if stderr is not null (#54)
Browse files Browse the repository at this point in the history
* Throwing error if stderr is not null

* Improved error message

* Removed core.error
  • Loading branch information
t-dedah authored Jun 17, 2021
1 parent 6212dde commit 857ecaf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/deploy/scope_managementgroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export async function DeployManagementGroupScope(azPath: string, region: string,
core.info("Creating deployment...")
var deploymentCode = await exec(`"${azPath}" deployment mg create ${azDeployParameters} -o json`, [], deployOptions);
if (commandStdErr.trim().length !== 0) {
core.error(commandStdErr)
throw new Error(`Deployment process failed as some lines were written to stderr: ${commandStdErr}`)
} else {
if (deploymentCode != 0) {
core.error("Deployment failed.")
Expand Down
2 changes: 1 addition & 1 deletion src/deploy/scope_resourcegroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export async function DeployResourceGroupScope(azPath: string, resourceGroupName
core.info("Creating deployment...")
var deploymentCode = await exec(`"${azPath}" deployment group create ${azDeployParameters} -o json`, [], deployOptions);
if (commandStdErr.trim().length !== 0) {
core.error(commandStdErr)
throw new Error(`Deployment process failed as some lines were written to stderr: ${commandStdErr}`)
} else {
if (deploymentCode != 0) {
core.error("Deployment failed.")
Expand Down
2 changes: 1 addition & 1 deletion src/deploy/scope_subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export async function DeploySubscriptionScope(azPath: string, region: string, te
core.info("Creating deployment...")
var deploymentCode = await exec(`"${azPath}" deployment sub create ${azDeployParameters} -o json`, [], deployOptions);
if (commandStdErr.trim().length !== 0) {
core.error(commandStdErr)
throw new Error(`Deployment process failed as some lines were written to stderr: ${commandStdErr}`)
} else {
if (deploymentCode != 0) {
core.error("Deployment failed.")
Expand Down

0 comments on commit 857ecaf

Please sign in to comment.