Rescuing from an Erlang error

Greetings,

Actually there is event simpler solution(s).

  1. xmerl_scan has quiet ({quiet, Flag}) as one of the options. When set to true xmerl behaves and nothing get’s error-logged. Details are here: http://erlang.org/doc/man/xmerl_scan.html

  2. I was experiencing same issue with false error reporting as @jaimeiniesta. And that’s Elixir Logger capturing erlang’s standard_error and logs it with error level to configured Logger backends. See :handle_otp_reports config option of the Elixir.Logger

  3. Solution with wrapping xmerl parsing in a separate process and setting group leader to stub GenServer didn’t work for me. But good implementation example could be found in ExUnit Capture logs/io sources: https://github.com/elixir-lang/elixir/blob/master/lib/ex_unit/lib/ex_unit/capture_io.ex

Cheers