From 44520b95b86a722f19378c46411073ce880764ef Mon Sep 17 00:00:00 2001 From: Anthony Molinaro Date: Mon, 19 Sep 2016 23:54:01 +0000 Subject: [PATCH] fix crash when http endpoint is missing --- ChangeLog | 3 +++ src/mondemand.app.src | 2 +- src/mondemand_config.erl | 12 ++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0b96fc..cc29204 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Version 6.4.1 (molinaro) + * don't crash if http trace endpoint is not set + Version 6.4.0 (molinaro) * now able to post traces over 65kb * updated the version of lwes dependency diff --git a/src/mondemand.app.src b/src/mondemand.app.src index 6b26ed2..a442d3a 100644 --- a/src/mondemand.app.src +++ b/src/mondemand.app.src @@ -1,7 +1,7 @@ { application, mondemand, [ { description, "Erlang Mondemand Bindings." }, - { vsn, "6.4.0" }, + { vsn, "6.4.1" }, { modules, [] }, { registered, [mondemand,mondemand_sup]}, { applications, [kernel,stdlib,syntax_tools,lwes,inets]}, diff --git a/src/mondemand_config.erl b/src/mondemand_config.erl index 1ed86a8..32ce336 100644 --- a/src/mondemand_config.erl +++ b/src/mondemand_config.erl @@ -259,10 +259,14 @@ get_http_config () -> {ok, File} -> case file:read_file (File) of {ok, Bin} -> - {match, [TraceEndPoint]} = - re:run (Bin, "MONDEMAND_HTTP_ENDPOINT_TRACE=\"([^\"]+)\"", - [{capture, all_but_first, list}]), - [{trace, TraceEndPoint}]; + case re:run (Bin, + "MONDEMAND_TRACE_HTTP_ENDPOINT=\"([^\"]+)\"", + [{capture, all_but_first, list}]) of + {match, [TraceEndPoint]} -> + [{trace, TraceEndPoint}]; + _ -> + {error, no_http_configured} + end; E -> E end;