Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Catch error when getting trace file info
Browse files Browse the repository at this point in the history
On win32 systems, deleting a trace file from out under RabbitMQ will lead to subsequent `{error, eacces}` errors.

Fixes #31
  • Loading branch information
lukebakken committed Oct 17, 2019
1 parent e0b99f2 commit 8509fbd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/rabbit_tracing_files.erl
Expand Up @@ -46,6 +46,12 @@ full_path(Name0) ->
%%--------------------------------------------------------------------

file_info(Name) ->
{ok, Info} = file:read_file_info(full_path(Name)),
[{name, list_to_binary(Name)},
{size, Info#file_info.size}].
Size = case file:read_file_info(full_path(Name)) of
{ok, Info} ->
Info#file_info.size;
{error, Error} ->
rabbit_log:warning("error getting file info for ~s: ~p",
[Name, Error]),
0
end,
[{name, list_to_binary(Name)}, {size, Size}].

0 comments on commit 8509fbd

Please sign in to comment.