diff options
author | Hans Nilsson <[email protected]> | 2016-05-02 13:08:18 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2016-05-02 13:08:18 +0200 |
commit | 8a7789a5814dad194310d08dafc4421d22b3c89f (patch) | |
tree | 95b22111cdd36b2022cbfa56e5304a141d173801 /lib/ssh/src/ssh_no_io.erl | |
parent | d32a045349d5f9156142aa57a932b6a270052d29 (diff) | |
parent | 5fa07312d27a7ff6826bf943e3b9d6575be3acf1 (diff) | |
download | otp-8a7789a5814dad194310d08dafc4421d22b3c89f.tar.gz otp-8a7789a5814dad194310d08dafc4421d22b3c89f.tar.bz2 otp-8a7789a5814dad194310d08dafc4421d22b3c89f.zip |
Merge branch 'hans/ssh/gen_statem/OTP-13267'
Diffstat (limited to 'lib/ssh/src/ssh_no_io.erl')
-rw-r--r-- | lib/ssh/src/ssh_no_io.erl | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/lib/ssh/src/ssh_no_io.erl b/lib/ssh/src/ssh_no_io.erl index 8144aac66e..1da257ed99 100644 --- a/lib/ssh/src/ssh_no_io.erl +++ b/lib/ssh/src/ssh_no_io.erl @@ -27,27 +27,39 @@ -export([yes_no/2, read_password/2, read_line/2, format/2]). + +-spec yes_no(any(), any()) -> no_return(). + 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"}}). + ssh_connection_handler:disconnect( + #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE, + description = "User interaction is not allowed"}, + {no_io_allowed, yes_no}). + + +-spec read_password(any(), any()) -> no_return(). 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"}}). + ssh_connection_handler:disconnect( + #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE, + description = "User interaction is not allowed"}, + {no_io_allowed, read_password}). + + +-spec read_line(any(), any()) -> no_return(). 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"}} ). + ssh_connection_handler:disconnect( + #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE, + description = "User interaction is not allowed"}, + {no_io_allowed, read_line}). + + +-spec format(any(), any()) -> no_return(). format(_, _) -> - throw({{no_io_allowed, format}, - #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE, - description = "User interaction is not allowed", - language = "en"}}). + ssh_connection_handler:disconnect( + #ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE, + description = "User interaction is not allowed"}, + {no_io_allowed, format}). |