Skip to content

Commit 1c6b31e

Browse files
committed
fix(file): handle file:write_file error return type
1 parent ced40f8 commit 1c6b31e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/es_store_file/src/es_store_file.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ store(Snapshot) ->
142142
),
143143
Path = snapshot_file_path(BaseName),
144144
ensure_dir(snapshots_dir()),
145-
file:write_file(Path, serialize_to_line(Snapshot), [])
145+
case file:write_file(Path, serialize_to_line(Snapshot), []) of
146+
ok -> ok;
147+
{error, Error} -> {warning, {write_error, Error}}
148+
end
146149
catch
147150
Class:Reason ->
148151
{warning, {Class, Reason}}

0 commit comments

Comments
 (0)