Skip to content

Expose a stable code on R2 unsatisfiable-range errors #8572

Open

Description

@irvinebroque

An R2 range error exposes 10039 only inside message text. HTTP handlers must parse the message to distinguish an unsatisfiable range from other storage failures and return 416.

Reproduce with an R2 binding:

await env.BUCKET.put('range-repro.txt', '0123456789');
try {
  await env.BUCKET.get('range-repro.txt', {
    range: {offset: 100, length: 5}
  });
} catch (e) {
  console.log(e.message, e.code, Object.getOwnPropertyNames(e));
} finally {
  await env.BUCKET.delete('range-repro.txt');
}

Observed remotely:

get: The requested range is not satisfiable (10039)
code: undefined
own properties: ["stack", "message"]

A control range {offset:2,length:3} returns 234; {suffix:0} also raises 10039.

Requested: expose the stable numeric code as an error field, retaining the existing message.

Compatibility date 2026-11-17; deployed with Wrangler 4.164.0.

Activity

  1. irvinebroque commented on Nov 18, 2026

    @irvinebroque
    CollaboratorAuthor

    @Carolx715 i think that the new JSRPC binding maybe has better shot at fixing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions