Skip to content

Commit

Permalink
Issue #939: Expose sftp connection errors
Browse files Browse the repository at this point in the history
  • Loading branch information
petersistrom authored and brendanheywood committed Feb 11, 2025
1 parent 5756549 commit b2a3c15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions classes/local/step/sftp_trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@ public function execute($input = null) {
// Upload to remote.
$this->upload($sftp, $sourcepath, $targetpath);
} catch (\Throwable $e) {
$this->enginestep->log->error($e->getMessage());
if (isset($sftp)) {
$sftp->disconnect();
}
throw new \moodle_exception($e->getMessage(), 'tool_dataflows');
}

return $input;
Expand Down

0 comments on commit b2a3c15

Please sign in to comment.