Skip to main content

Class: BlobFetchError

Defined in: src/atproto/errors/repository-errors.ts:202

Error thrown when blob fetching fails.

Remarks

This error indicates failure to fetch a blob (PDF, image, etc.) from a user's PDS. The blob may exist but be inaccessible, or may not exist.

Example

try {
const stream = await repository.getBlob(did, cid);
} catch (error) {
if (error instanceof BlobFetchError) {
logger.warn('Blob fetch failed', { cid: error.cid, reason: error.reason });
}
}

Extends

Constructors

new BlobFetchError()

new BlobFetchError(message, did, cid, reason, cause?): BlobFetchError

Defined in: src/atproto/errors/repository-errors.ts:229

Creates a new BlobFetchError.

Parameters

message

string

Description of the fetch failure

did

string

DID of the repository owner

cid

string

CID of the blob

reason

Specific reason for failure

"not_found" | "network_error" | "pds_error" | "too_large"

cause?

Error

Original error (if chained)

Returns

BlobFetchError

Overrides

ChiveError.constructor

Properties

cause?

readonly optional cause: Error

Defined in: src/types/errors.ts:71

Original error that caused this error (if any).

Remarks

Error chaining allows tracking the full error context through multiple layers of the application. Useful for debugging complex error scenarios.

Example

try {
await fetchData();
} catch (err) {
throw new ValidationError('Failed to validate data', 'field', 'required', err as Error);
}

Inherited from

ChiveError.cause


cid

readonly cid: string

Defined in: src/atproto/errors/repository-errors.ts:208

CID of the blob that failed to fetch.


code

readonly code: "BLOB_FETCH_ERROR" = 'BLOB_FETCH_ERROR'

Defined in: src/atproto/errors/repository-errors.ts:203

Machine-readable error code.

Remarks

Error codes are unique identifiers for error types, enabling programmatic error handling (switch statements, error maps), error tracking in monitoring systems, and client-side error translation (i18n).

Overrides

ChiveError.code


did

readonly did: string

Defined in: src/atproto/errors/repository-errors.ts:213

DID of the repository owner.


reason

readonly reason: "not_found" | "network_error" | "pds_error" | "too_large"

Defined in: src/atproto/errors/repository-errors.ts:218

Reason for fetch failure.