mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
dataexport: correctly handle 403 errors
This commit is contained in:
@@ -203,7 +203,8 @@ api.exportUserAvatarPng = {
|
|||||||
try {
|
try {
|
||||||
response = await got.head(s3url);
|
response = await got.head(s3url);
|
||||||
} catch (gotError) {
|
} 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;
|
throw gotError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user