aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2019-08-19 15:14:30 +0200
committerHans Nilsson <[email protected]>2019-08-19 15:14:30 +0200
commita5109cf75597c347146b2ee0e09474b94ba00677 (patch)
treef2446125a024cbf640c91d606a77e1c9e63ad257
parentd14919b70af5d08970f0e92aded2b375a79f4d94 (diff)
parentba15162dad8e88fee801827b2154265b96b1f6d2 (diff)
downloadotp-a5109cf75597c347146b2ee0e09474b94ba00677.tar.gz
otp-a5109cf75597c347146b2ee0e09474b94ba00677.tar.bz2
otp-a5109cf75597c347146b2ee0e09474b94ba00677.zip
Merge branch 'hans/ssh/early_crash_fail_logging/ERL-990/OTP-15962' into maint
* hans/ssh/early_crash_fail_logging/ERL-990/OTP-15962: 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 ->