Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/storage/object/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ export default async function getObject(env, { bucket, org, key }, head = false)
etag: resp.ETag,
};
} catch (e) {
return { body: '', status: e.$metadata?.httpStatusCode || 404, contentLength: 0 };
if (!e.$metadata?.httpStatusCode) {
// eslint-disable-next-line no-console
console.error('Error getting object without httpStatusCode', e);
}
return { body: '', status: e.$metadata?.httpStatusCode || 500, contentLength: 0 };
}
}
const url = await getSignedUrl(client, new HeadObjectCommand(input), { expiresIn: 3600 });
Expand Down