aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-11-11 09:52:01 +0100
committerIngela Anderton Andin <[email protected]>2013-11-13 10:58:19 +0100
commitec86d38d997333bee63c10141da63b68ae1686fc (patch)
treee246146e3f2b6fbaeb7698e24f8199dc283c934f /lib/ssh/src
parent68263a48bfbdac4dc219a91f06af3d535d881850 (diff)
downloadotp-ec86d38d997333bee63c10141da63b68ae1686fc.tar.gz
otp-ec86d38d997333bee63c10141da63b68ae1686fc.tar.bz2
otp-ec86d38d997333bee63c10141da63b68ae1686fc.zip
ssh: Enhance error handling
Diffstat (limited to 'lib/ssh/src')
-rw-r--r--lib/ssh/src/ssh_no_io.erl23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/ssh/src/ssh_no_io.erl b/lib/ssh/src/ssh_no_io.erl
index 2c8dd92ee2..9f83506cdd 100644
--- a/lib/ssh/src/ssh_no_io.erl
+++ b/lib/ssh/src/ssh_no_io.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -22,18 +22,31 @@
%%% Description: ssh_io replacement that throws on everything
-module(ssh_no_io).
+-include("ssh_transport.hrl").
-export([yes_no/1, read_password/1, read_line/1, format/2]).
yes_no(_Prompt) ->
- throw({no_io_allowed, yes_no}).
+ throw({{no_io_allowed, yes_no},
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "User interaction is not allowed",
+ language = "en"}}).
read_password(_Prompt) ->
- throw({no_io_allowed, read_password}).
+ throw({{no_io_allowed, read_password},
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "User interaction is not allowed",
+ language = "en"}}).
read_line(_Prompt) ->
- throw({no_io_allowed, read_line}).
+ throw({{no_io_allowed, read_line},
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "User interaction is not allowed",
+ language = "en"}} ).
format(_Fmt, _Args) ->
- throw({no_io_allowed, format}).
+ throw({{no_io_allowed, format},
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = "User interaction is not allowed",
+ language = "en"}}).