Skip to content

Commit

Permalink
mod_filestore: handle S3 forbidden as non retryable error.
Browse files Browse the repository at this point in the history
(cherry picked from commit 23fbad1)
  • Loading branch information
mworrell committed Feb 28, 2017
1 parent 9396c14 commit 0568caa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/mod_filestore/mod_filestore.erl
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ load_cache(Props, Context) ->
StreamFun = fun(CachePid) ->
s3filez:stream(Cred,
Location1,
fun({error, enoent}) ->
lager:error("File store remote file is gone ~p", [Location]),
ok = m_filestore:mark_error(Id, enoent, Ctx),
fun({error, FinalError})
when FinalError =:= enoent; FinalError =:= forbidden ->
lager:error("File store remote file is ~p ~p", [FinalError, Location]),
ok = m_filestore:mark_error(Id, FinalError, Ctx),
exit(normal);
({error, _} = Error) ->
% Abnormal exit when receiving an error.
Expand Down

0 comments on commit 0568caa

Please sign in to comment.