Skip to content

Commit 9ab391e

Browse files
author
Claes Wikstrom
committed
warn when crypto app is not there
1 parent abe2833 commit 9ab391e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/yaws.hrl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,6 @@
284284
id
285285
}).
286286

287+
%% Typically used in error printouts as in:
288+
%% error_logger:format("Err ~p at ~p~n", [Reason, ?stack()])
289+
-define(stack(), try throw(1) catch _:_ -> erlang:get_stacktrace() end).

src/yaws_ctl.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ rand() ->
6363
crypto:start(),
6464
crypto:rand_uniform(0, 1 bsl 64)
6565
catch
66-
_ ->
66+
_:_ ->
67+
error_logger:warning_msg("Running without crypto app\n"),
6768
{A1, A2, A3}=now(),
6869
random:seed(A1, A2, A3),
6970
random:uniform(1 bsl 64)

0 commit comments

Comments
 (0)