Skip to content

Commit 5bc58bc

Browse files
committed
When user supply a wrong or already removed uploadId, return a 404 instead of 500
1 parent 1a44740 commit 5bc58bc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/registry/r2.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,9 @@ export class R2Registry implements Registry {
713713
return { response: new InternalError() };
714714
}
715715
if (hashedState === null || !hashedState.state) {
716-
return { response: new InternalError() };
716+
return {
717+
response: new Response(null, { status: 404 }),
718+
}
717719
}
718720
const state = hashedState.state;
719721

0 commit comments

Comments
 (0)