Skip to content

Commit 6256b90

Browse files
[BUGS-3638] Handle error processing workflow in connection:set command. (#2563)
* Handle 400 error in connection:set command. * Fix linter. * Fix linter. * We should check now on workflow processing. * Coding standards. * Update src/Commands/Connection/SetCommand.php Co-authored-by: Brian Weaver <[email protected]> --------- Co-authored-by: Brian Weaver <[email protected]>
1 parent bfc68b2 commit 6256b90

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Commands/Connection/SetCommand.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,18 @@ public function connectionSet($site_env, $mode)
7373
throw $e;
7474
}
7575

76-
$this->processWorkflow($workflow);
76+
try {
77+
$this->processWorkflow($workflow);
78+
} catch (TerminusException $e) {
79+
if (strpos($e->getMessage(), 'build_status is building') !== false) {
80+
throw new TerminusException(
81+
'Cannot switch to SFTP mode because the most recent Integrated Composer build ' .
82+
'is either still running or encountered errrors.' .
83+
'Please check your latest commit in the dashboard.'
84+
);
85+
}
86+
throw $e;
87+
}
7788
$this->log()->notice($workflow->getMessage());
7889
}
7990
}

0 commit comments

Comments
 (0)