Skip to content

Commit 6750db7

Browse files
committed
docs(cloudflare): explain operation error matching
1 parent 0621269 commit 6750db7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • packages/cloudflare/src/client

‎packages/cloudflare/src/client/api.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ function findMatchingError(
256256
return bestMatch;
257257
}
258258

259+
// Some Cloudflare endpoints return bare HTTP failures instead of the standard
260+
// `{ success: false, errors: [...] }` envelope. Generated operation schemas can
261+
// still declare status-based error matchers, so try those before falling back
262+
// to generic HTTP errors.
259263
function matchOperationError(
260264
errors: readonly ApiErrorClass[] | undefined,
261265
code: number | undefined,

0 commit comments

Comments
 (0)