More debug logging

This commit is contained in:
Manohar Gupta 2026-05-10 14:37:34 +05:30
parent c13b77e5e8
commit c8950589b3

View file

@ -8,8 +8,11 @@ function getR2() {
const secretKey = process.env.R2_SECRET_ACCESS_KEY;
const bucket = process.env.R2_BUCKET_NAME;
// Debug: log what's available
console.log("R2 envs:", { accountId: !!accountId, accessKeyId: !!accessKeyId, secretKey: !!secretKey, bucket: !!bucket });
if (!accountId || !accessKeyId || !secretKey || !bucket) {
throw new Error(`Missing R2 config`);
throw new Error(`Missing R2 config: accountId=${!!accountId}, accessKeyId=${!!accessKeyId}, secretKey=${!!secretKey}, bucket=${!!bucket}`);
}
// Use public development URL (from R2 bucket settings)