aboutsummaryrefslogtreecommitdiff
path: root/acid.go
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-12-26 16:18:37 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-12-26 16:18:37 +0100
commit55a66939426b8d395d67af1815fb137148b88c1c (patch)
tree02b1c8499c22d9b10cc7ef265d0eb13f371e8fb3 /acid.go
parentd5981249b1e8fc85661d7427cfa96ab0c10eef8c (diff)
downloadacid-55a66939426b8d395d67af1815fb137148b88c1c.tar.gz
acid-55a66939426b8d395d67af1815fb137148b88c1c.tar.xz
acid-55a66939426b8d395d67af1815fb137148b88c1c.zip
Fix deployment error processing
Diffstat (limited to 'acid.go')
-rw-r--r--acid.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/acid.go b/acid.go
index 00d5a4e..350c9d8 100644
--- a/acid.go
+++ b/acid.go
@@ -1317,19 +1317,20 @@ func executorRunTask(ctx context.Context, task Task) error {
defer client.Close()
var (
- ee1 *ssh.ExitError
- ee2 *executorError
+ eeSSH *ssh.ExitError
+ eeExec *exec.ExitError
+ ee3 *executorError
)
err = executorBuild(ctxRunner, client, rt)
if err != nil {
locked(func() {
- if errors.As(err, &ee1) {
+ if errors.As(err, &eeSSH) {
rt.DB.State, rt.DB.Detail = taskStateFailed, "Scripts failed"
fmt.Fprintf(&rt.TaskLog, "\n%s\n", err)
- } else if errors.As(err, &ee2) {
- rt.DB.State, rt.DB.Detail = taskStateError, ee2.Detail
- fmt.Fprintf(&rt.TaskLog, "\n%s\n", ee2.Err)
+ } else if errors.As(err, &ee3) {
+ rt.DB.State, rt.DB.Detail = taskStateError, ee3.Detail
+ fmt.Fprintf(&rt.TaskLog, "\n%s\n", ee3.Err)
} else {
rt.DB.State, rt.DB.Detail = taskStateError, ""
fmt.Fprintf(&rt.TaskLog, "\n%s\n", err)
@@ -1349,12 +1350,12 @@ func executorRunTask(ctx context.Context, task Task) error {
locked(func() {
if err == nil {
rt.DB.State, rt.DB.Detail = taskStateSuccess, ""
- } else if errors.As(err, &ee1) {
+ } else if errors.As(err, &eeExec) {
rt.DB.State, rt.DB.Detail = taskStateFailed, "Deployment failed"
fmt.Fprintf(&rt.DeployLog, "\n%s\n", err)
- } else if errors.As(err, &ee2) {
- rt.DB.State, rt.DB.Detail = taskStateError, ee2.Detail
- fmt.Fprintf(&rt.DeployLog, "\n%s\n", ee2.Err)
+ } else if errors.As(err, &ee3) {
+ rt.DB.State, rt.DB.Detail = taskStateError, ee3.Detail
+ fmt.Fprintf(&rt.DeployLog, "\n%s\n", ee3.Err)
} else {
rt.DB.State, rt.DB.Detail = taskStateError, ""
fmt.Fprintf(&rt.DeployLog, "\n%s\n", err)