Skip to content

Commit

Permalink
fix crash when http endpoint is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
djnym committed Sep 19, 2016
1 parent 81281a4 commit 44520b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/mondemand.app.src
Original file line number Diff line number Diff line change
@@ -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]},
Expand Down
12 changes: 8 additions & 4 deletions src/mondemand_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 44520b9

Please sign in to comment.