aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/src
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-03-16 21:22:29 +0100
committerSverker Eriksson <[email protected]>2018-03-22 16:22:34 +0100
commit6ee8cc56db53fd7951fb3bacfd6621c72fdf3ced (patch)
tree99cd409917896c14ecd6346199371c8fdc9c4083 /lib/crypto/src
parentcbc7ef1f665423aabba3836b79017682ca1b0816 (diff)
downloadotp-6ee8cc56db53fd7951fb3bacfd6621c72fdf3ced.tar.gz
otp-6ee8cc56db53fd7951fb3bacfd6621c72fdf3ced.tar.bz2
otp-6ee8cc56db53fd7951fb3bacfd6621c72fdf3ced.zip
crypto: Improve load error message
to only suggest missing OpenSSL if dlopen fails (load_failed).
Diffstat (limited to 'lib/crypto/src')
-rw-r--r--lib/crypto/src/crypto.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index ec2a1dba0a..46775989ae 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -847,8 +847,13 @@ on_load() ->
case Status of
ok -> ok;
{error, {E, Str}} ->
- error_logger:error_msg("Unable to load crypto library. Failed with error:~n\"~p, ~s\"~n"
- "OpenSSL might not be installed on this system.~n",[E,Str]),
+ Fmt = "Unable to load crypto library. Failed with error:~n\"~p, ~s\"~n~s",
+ Extra = case E of
+ load_failed ->
+ "OpenSSL might not be installed on this system.\n";
+ _ -> ""
+ end,
+ error_logger:error_msg(Fmt, [E,Str,Extra]),
Status
end.