Skip to content

Commit

Permalink
dataexport: correctly handle 403 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
paglias committed May 27, 2016
1 parent c08df99 commit a9d4bbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/server/controllers/top-level/dataexport.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ api.exportUserAvatarPng = {
try {
response = await got.head(s3url);
} catch (gotError) {
if (gotError.code !== 'ENOTFOUND' && gotError.statusCode !== 404) {
// If the file does not exist AWS S3 can return a 403 error
if (gotError.code !== 'ENOTFOUND' && gotError.statusCode !== 404 && gotError.statusCode !== 403) {
throw gotError;
}
}
Expand Down

0 comments on commit a9d4bbd

Please sign in to comment.