aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2019-08-16 12:59:08 +0200
committerHans Nilsson <[email protected]>2019-08-16 15:40:51 +0200
commitba15162dad8e88fee801827b2154265b96b1f6d2 (patch)
tree79d291de19a574ce79c6d62f5743edf38ba7941f
parent5686bebd81b3055e5c688e1544798b8c0fab426c (diff)
downloadotp-ba15162dad8e88fee801827b2154265b96b1f6d2.tar.gz
otp-ba15162dad8e88fee801827b2154265b96b1f6d2.tar.bz2
otp-ba15162dad8e88fee801827b2154265b96b1f6d2.zip
ssh: Don't assume Reason to be a string()
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index 9df4f1e2d7..4e9ade327b 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -2040,7 +2040,13 @@ log(Tag, D, Reason) ->
end.
-do_log(F, Reason, #data{ssh_params = S}) ->
+do_log(F, Reason0, #data{ssh_params = S}) ->
+ Reason =
+ try io_lib:format("~s",[Reason0])
+ of _ -> Reason0
+ catch
+ _:_ -> io_lib:format("~p",[Reason0])
+ end,
case S of
#ssh{role = Role} when Role==server ;
Role==client ->