Skip to content

Commit 00e729e

Browse files
authored
fix: use correct R2 Catalog error code in pipelines setup (#12694)
1 parent dd78eb5 commit 00e729e

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

‎.changeset/rude-ends-battle.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Fix `wrangler pipelines setup` failing for Data Catalog sinks on new buckets by using the correct R2 Catalog API error code (`40401`).

‎packages/wrangler/src/__tests__/pipelines-setup.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ describe("wrangler pipelines setup", () => {
365365
if (!exists) {
366366
return HttpResponse.json(
367367
createFetchResult(null, false, [
368-
{ code: 10006, message: "catalog not found" },
368+
{ code: 40401, message: "Warehouse not found" },
369369
]),
370370
{ status: 404 }
371371
);

‎packages/wrangler/src/pipelines/cli/setup.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async function ensureCatalogEnabled(
130130
const catalog = await getR2Catalog(config, accountId, bucketName);
131131
catalogEnabled = catalog.status === "active";
132132
} catch (err) {
133-
if (err instanceof APIError && err.code === 10006) {
133+
if (err instanceof APIError && err.code === 40401) {
134134
// Catalog not enabled yet
135135
} else {
136136
throw err;

0 commit comments

Comments
 (0)