Skip to content
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

fix: sasjs deploy should return error when deployment fails #1315

Merged
merged 1 commit into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/commands/deploy/internal/deployToSASJSWithServicePack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export async function deployToSasjsWithServicePack(
result = await sasjsApiClient
.deployZipFile(zipFilePath, authConfig)
.catch((err) => {
process.logger?.error('deployToSASjs Error', err)
process.logger?.error('deployServicePack error', err)
throw new Error('Deploy service pack error')
})
} else {
const jsonContent = await readFile(jsonFilePath)
Expand All @@ -42,7 +43,8 @@ export async function deployToSasjsWithServicePack(
result = await sasjsApiClient
.deploy(payload, target.appLoc, authConfig)
.catch((err) => {
process.logger?.error('deployToSASjs Error', err)
process.logger?.error('deployServicePack error', err)
throw new Error('Deploy service pack error')
})
}

Expand All @@ -54,6 +56,8 @@ export async function deployToSasjsWithServicePack(
`Payload example:\n${JSON.stringify(result.example, null, 2)}`
)
}

throw new Error('Deploy service pack error')
}

if (streamConfig?.streamWeb && result?.streamServiceName) {
Expand Down
7 changes: 5 additions & 2 deletions src/commands/deploy/internal/executeDeployScriptSasViya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ export async function executeDeployScriptSasViya(
await createFile(logFilePath, log)

if (executionResult.completedWithError) {
process.logger?.error(`Log is available at ${logFilePath}`)
throw new Error('Deployment process completed with error')
process.logger?.error(
`Deployment failed with errors! Log is available at ${logFilePath}`
)

throw new Error(`Deployment failed.`)
}

process.logger?.success(
Expand Down