Skip to content

Commit

Permalink
Add exception handling to the gradle-build
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshLK committed Jul 1, 2024
1 parent aa11e51 commit 9e69b73
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ class BallerinaPlugin implements Plugin<Project> {
"""
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
println "Executing command on windows: ${balPackWithDocker}"
commandLine 'cmd', '/c', "$balPackWithDocker"
try {
commandLine 'cmd', '/c', "$balPackWithDocker"
} catch (Exception e) {
println "[ERROR] Command execution failed: ${e.message}"
}
} else {
commandLine 'sh', '-c', "$balPackWithDocker"
}
Expand Down

0 comments on commit 9e69b73

Please sign in to comment.