Skip to content

Commit

Permalink
Merge pull request #44 from internetee/43-improve-logging-of-erroneou…
Browse files Browse the repository at this point in the history
…s-frames

Add logging for malformed frames
  • Loading branch information
vohmar authored Jan 28, 2021
2 parents 1ff9e87 + e03ba67 commit 01b2682
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/epp_proxy/src/epp_tcp_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ handle_cast(process_command,
#invalid_frame{message = Message, code = Code,
cl_trid = ClTRID} ->
Command = "error",
lager:error("The following frame is erroneous: [~p]~n",
[RawFrame]),
Request = epp_http_client:request_builder(#{command =>
Command,
session_id => SessionId,
Expand Down Expand Up @@ -161,6 +163,8 @@ log_on_timeout(State) ->
%% Get status, XML record, command and clTRID if defined.
%% Otherwise return an invalid frame with predefined error message and code.
parse_frame(Frame) ->
lager:info("Got the following frame to parse: [~p]~n",
[Frame]),
ClTRID = epp_xml:find_cltrid(Frame),
case epp_xml:parse(Frame) of
{ok, XMLRecord} ->
Expand Down

0 comments on commit 01b2682

Please sign in to comment.