Skip to content

Commit 7b08bba

Browse files
committed
handled the undefined case
1 parent 631de1b commit 7b08bba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/webapp/app/v3/r2.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ export async function downloadPacketFromObjectStore(
9494
logger.debug("Downloading from object store", { url: url.href });
9595

9696
async function fetchWithRetry(url:string,retries =3,delay=500):Promise<Response>{
97+
98+
if (!r2) {
99+
throw new Error("Object store credentials are not set");
100+
}
101+
97102
for(let attempt =1; attempt<=retries;attempt++){
98103
try {
99104
const response = await r2.fetch(url);

0 commit comments

Comments
 (0)