anchor.diff:              lists:join([$\n,Sep,<<"   ">>], [""|Errors])
       end.
   
  -get_extended_error(Reason, M, Info, StackTrace) ->
  +get_extended_error(Reason, [{M,_F,_As,Info}|_] = StackTrace) ->
       case lists:keyfind(error_info, 1, Info) of
           {error_info,ErrorInfoMap} when is_map(ErrorInfoMap) ->
               FormatModule = maps:get(module, ErrorInfoMap, M),
  
positive.code: argss(I) ->
      io_lib:fwrite(<<"~w arguments">>, [I]).
  
  format_stacktrace1(S0, Stack0, PF, SF, Enc, CL, Reason) ->
      Stack1 = lists:dropwhile(fun({M,F,A,_}) -> SF(M, F, A)
                               end, lists:reverse(Stack0)),
      S = ["  " | S0],
      Stack = lists:reverse(Stack1),
      format_stacktrace2(S, Stack, 1, PF, Enc, CL, Reason).
  
  format_stacktrace2(_S, _Stack, _N, _PF, _Enc, _CL=0, _Reason) ->
      [];
  format_stacktrace2(S, [{M,F,A,L}|Fs], N, PF, Enc, CL, Reason) when is_integer(A) ->
      Cs = io_lib:fwrite(<<"~s~s ~ts ~ts">>,
                         [sep(N, S), origin(N, M, F, A),
                          mfa_to_string(M, F, A, Enc),
                          location(L)]),
      CL1 = sub(CL, Cs, Enc),
      [Cs | format_stacktrace2(S, Fs, N + 1, PF, Enc, CL1, Reason)];
  format_stacktrace2(S, [{M,F,As,_Info}|Fs]=StackTrace, N, PF, Enc, CL, Reason)
    when is_list(As) ->
      A = length(As),
      CalledAs = [S,<<"   called as ">>],
      C = format_call("", CalledAs, {M,F}, As, PF, Enc, CL),
      FormattedError = call_format_error(Reason, StackTrace, sep(N, S)),
      Cs = io_lib:fwrite(<<"~s~s ~ts\n~s~ts~ts">>,
                         [sep(N, S), origin(N, M, F, A),
                          mfa_to_string(M, F, A, Enc),
                          CalledAs, C, FormattedError]),
      CL1 = sub(CL, Enc, Cs),
      [Cs | format_stacktrace2(S, Fs, N + 1, PF, Enc, CL1, Reason)];
  format_stacktrace2(_S, [], _N, _PF, _Enc, _CL, _Reason) ->
      "".
  
  call_format_error(Reason, [{M,_F,As,Info}|_]=StackTrace, Sep) ->
      ErrorMap = get_extended_error(Reason, M, Info, StackTrace),
      case format_arg_errors(1, As, ErrorMap) of
          [] ->
              [];
  
negative.code:                       %% Reserve one third for the stacktrace.
                        CharsLimit div 3
                end,
  
      ErrorMap = get_extended_error(Reason, Trace),
  
      St = format_stacktrace1(S, Trace, FormatFun, StackFun,
                              Encoding, StLimit, Reason, ErrorMap),
      Lim = sub(sub(CharsLimit, exited(Class), latin1), St, Encoding),
      DefaultReason = explain_reason(Term, Class, Trace1, FormatFun, S, Encoding, Lim),
      Expl0 = maps:get(reason, ErrorMap, DefaultReason),
  
      FormatString = case Encoding of
                         latin1 -> "~s~s";
                         _ -> "~s~ts"
  