summaryrefslogtreecommitdiff
path: root/modules/ssh
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2015-12-04 21:52:05 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2015-12-04 21:52:05 +0300
commit42313151a69da5354b51a243971bf281c4c6f93d (patch)
tree0afb12e4d9d4ec9694132584d77f28ed76ac877f /modules/ssh
parentchannel.scm: Add remote pipes (diff)
downloadguile-ssh-42313151a69da5354b51a243971bf281c4c6f93d.tar.gz
channel.scm (open-remote-pipe): Handle errors
* modules/ssh/channel.scm (open-remote-pipe): Handle errors.
Diffstat (limited to 'modules/ssh')
-rw-r--r--modules/ssh/channel.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/ssh/channel.scm b/modules/ssh/channel.scm
index e65d946..eddb91b 100644
--- a/modules/ssh/channel.scm
+++ b/modules/ssh/channel.scm
@@ -109,12 +109,13 @@ issued."
;;; High-level procedures.
-;; TODO: Add error handling.
(define (open-remote-pipe session command)
"Execute a COMMAND on the remote host using a SESSION with a pipe to it.
The pipe works in both directions. Returns newly created port (channel)."
(let ((channel (make-channel session)))
+ (unless channel
+ (throw 'guile-ssh-error "Could not create a channel" session command))
(channel-open-session channel)
(channel-request-pty channel)
(channel-request-exec channel command)