@backblaze-labs/b2-mcp
    Preparing search index...

    Function codedError

    • Build an error carrying its own HTTP status and code.

      parseB2Error reaches its internal_error/500 tail only for errors with no code of their own, so a bare new Error() always reads as a server fault. Build every deliberate refusal here instead, so the classification is chosen. It stays an Error, so stack traces and rejects.toThrow() still work.

      Parameters

      • status: number
      • code: string
      • message: string

      Returns Error & B2ApiError

      An Error carrying the given status and code.