mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Silence the expected set_env_missing error
This commit is contained in:
parent
36debe707a
commit
2915c6d98c
1 changed files with 10 additions and 1 deletions
|
@ -50,6 +50,13 @@ init_dispatch(_) ->
|
||||||
{"/", hello_h, []}
|
{"/", hello_h, []}
|
||||||
]}]).
|
]}]).
|
||||||
|
|
||||||
|
%% Logger function silencing the expected crash.
|
||||||
|
|
||||||
|
error("Ranch listener " ++ _, [set_env_missing|_]) ->
|
||||||
|
ok;
|
||||||
|
error(Format, Args) ->
|
||||||
|
error_logger:error_msg(Format, Args).
|
||||||
|
|
||||||
%% Tests.
|
%% Tests.
|
||||||
|
|
||||||
restart_gracefully(Config) ->
|
restart_gracefully(Config) ->
|
||||||
|
@ -97,7 +104,9 @@ set_env(Config0) ->
|
||||||
|
|
||||||
set_env_missing(Config0) ->
|
set_env_missing(Config0) ->
|
||||||
doc("Live replace a middleware environment value when env was not provided."),
|
doc("Live replace a middleware environment value when env was not provided."),
|
||||||
Config = cowboy_test:init_http(?FUNCTION_NAME, #{}, Config0),
|
Config = cowboy_test:init_http(?FUNCTION_NAME, #{
|
||||||
|
logger => ?MODULE
|
||||||
|
}, Config0),
|
||||||
try
|
try
|
||||||
ConnPid1 = gun_open(Config),
|
ConnPid1 = gun_open(Config),
|
||||||
Ref1 = gun:get(ConnPid1, "/"),
|
Ref1 = gun:get(ConnPid1, "/"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue