From 90d42a1b0ba0bda756c12077fc52202c1b8222a1 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Tue, 23 Jul 2024 14:39:57 +0200 Subject: [PATCH] Make manifest usage log errors non-fatal (#3962) --- src/Types.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Types.jl b/src/Types.jl index 7f9d321a67..df2284112d 100644 --- a/src/Types.jl +++ b/src/Types.jl @@ -622,7 +622,12 @@ function write_env_usage(source_file::AbstractString, usage_filepath::AbstractSt ## Atomically write usage file using process id locking FileWatching.mkpidlock(usage_file * ".pid", stale_age = 3) do usage = if isfile(usage_file) - TOML.parsefile(usage_file) + try + TOML.parsefile(usage_file) + catch err + @warn "Failed to parse usage file `$usage_file`, ignoring." err + Dict{String, Any}() + end else Dict{String, Any}() end