anchor.diff:                  maybe_finish(PoolName, CallbackModule, ExtendedCtx, TaskID, Executor, ErrorDescription2, Canceled3)
               catch
                   E3:R3 ->
  -                    ?error_stacktrace("Checking finish of job ~s of task ~p (module ~p) error ~p:~p",
  +                    ?log_error_with_stacktrace("Checking finish of job ~s of task ~p (module ~p) error ~p:~p",
                           [to_string(CallbackModule, Job), TaskID, CallbackModule, E3, R3])
               end
       end,
  
positive.code:             {ok, _} -> {ID, ExtendedCtx};
              {error, other_node} -> {ID, other_node}
          end
      end, TaskIDs).
negative.code: -define(DEFAULT_GROUP, <<"main_group">>).
  -define(DEFAULT_ENVIRONMENT_ID, <<"default_executor">>).
  
  %% When to_string/1 function is not implemented by the callback module,
  %% str_utils:format/1 is used to print job in logs (see to_string/1 function).
  %% Unfortunately, an exception is thrown and handled inside this function
  %% and because of that macro ?error_stacktrace prints wrong stacktrace.
  %% This macro is used to bypass the problem.
  -define(log_error_with_stacktrace(Format, Args),
      log_error_with_stacktrace(erlang:get_stacktrace(), Format, Args)
  ).
  
  %%%===================================================================
  %%% API
  %%%===================================================================
  