anchor.diff:                              {error, {Type, Reason0}}
                       end,
                   case fslogic_remote:postrouting(NextCTX, PrePostProcessResponse, UpdatedRequest) of
  -                    undefined -> throw({unable_to_reroute_message, PrePostProcessResponse});
  +                    undefined ->
  +                        throw({unable_to_reroute_message, PrePostProcessResponse});
                       LocalResponse -> LocalResponse
                   end
           end
       catch
           Reason ->
               %% Manually thrown error, normal interrupt case.
  -            report_error(Request, RequestType, Reason, debug);
  +            report_error(Request, RequestType, Reason, debug, erlang:get_stacktrace());
           error:{badmatch, Reason} ->
               %% Bad Match assertion - something went wrong, but it could be expected (e.g. file not found assertion).
  -            report_error(Request, RequestType, Reason, warning);
  +            report_error(Request, RequestType, Reason, warning, erlang:get_stacktrace());
           error:{case_clause, Reason} ->
               %% Case Clause assertion - something went seriously wrong and we should know about it.
  -            report_error(Request, RequestType, Reason, error);
  +            report_error(Request, RequestType, Reason, error, erlang:get_stacktrace());
           error:Reason ->
               %% Something went horribly wrong. This should not happen.
  -            report_error(Request, RequestType, Reason, error)
  +            report_error(Request, RequestType, Reason, error, erlang:get_stacktrace())
       end.
   
   %%--------------------------------------------------------------------
  
positive.code:     #event{object = #write_event{size = Size, blocks = Blocks,
          file_uuid = FileGUID, file_size = FileSize}, counter = Counter} = Event,
  
          {FileUUID, SpaceId} = fslogic_uuid:unpack_guid(FileGUID),
          {ok, #document{value = #session{identity = #user_identity{
              user_id = UserId}}}} = session:get(SessId),
          monitoring_event:emit_write_statistics(SpaceId, UserId, Size, Counter),
  
          UpdatedBlocks = lists:map(fun(#file_block{file_id = FileId, storage_id = StorageId} = Block) ->
              {ValidFileId, ValidStorageId} = file_location:validate_block_data(FileUUID, FileId, StorageId),
              Block#file_block{file_id = ValidFileId, storage_id = ValidStorageId}
          end, Blocks),
  
          case replica_updater:update(FileUUID, UpdatedBlocks, FileSize, true, undefined) of
              {ok, size_changed} ->
                  {ok, #document{value = #session{identity = #user_identity{
                      user_id = UserId}}}} = session:get(SessId),
                  fslogic_times:update_mtime_ctime({uuid, FileUUID}, UserId),
                  fslogic_event:emit_file_attr_update({uuid, FileUUID}, [SessId]),
                  fslogic_event:emit_file_location_update({uuid, FileUUID}, [SessId]);
              {ok, size_not_changed} ->
                  {ok, #document{value = #session{identity = #user_identity{
                      user_id = UserId}}}} = session:get(SessId),
                  fslogic_times:update_mtime_ctime({uuid, FileUUID}, UserId),
                  fslogic_event:emit_file_location_update({uuid, FileUUID}, [SessId]);
              {error, Reason} ->
                  ?error("Unable to update blocks for file ~p due to: ~p.", [FileUUID, Reason]),
                  {error, Reason}
          end.
  
  
  %%--------------------------------------------------------------------
  
negative.code: %%--------------------------------------------------------------------
  -spec handle(Request) -> Result when
      Request ::
      ping |
      healthcheck |
      {fuse_request, SessId :: session:id(), FuseRequest :: #fuse_request{}} |
      {file_request, SessId :: session:id(), FileRequest :: #file_request{}} |
      {provider_request, SessId :: session:id(), ProviderRequest :: #provider_request{}} |
      {proxyio_request, SessId :: session:id(), ProxyIORequest :: #proxyio_request{}},
      Result :: nagios_handler:healthcheck_response() | ok | {ok, Response} |
      {error, Reason} | pong,
      Response :: term(),
      Reason :: term().
  handle(ping) ->
  