Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/rude-ends-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

Fix `wrangler pipelines setup` failing for Data Catalog sinks on new buckets by using the correct R2 Catalog API error code (`40401`).
2 changes: 1 addition & 1 deletion packages/wrangler/src/__tests__/pipelines-setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ describe("wrangler pipelines setup", () => {
if (!exists) {
return HttpResponse.json(
createFetchResult(null, false, [
{ code: 10006, message: "catalog not found" },
{ code: 40401, message: "Warehouse not found" },
]),
{ status: 404 }
);
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/pipelines/cli/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async function ensureCatalogEnabled(
const catalog = await getR2Catalog(config, accountId, bucketName);
catalogEnabled = catalog.status === "active";
} catch (err) {
if (err instanceof APIError && err.code === 10006) {
if (err instanceof APIError && err.code === 40401) {
// Catalog not enabled yet
} else {
throw err;
Expand Down
Loading