Class: RecordFetchError
Defined in: src/atproto/errors/repository-errors.ts:154
Error thrown when record fetching fails.
Remarks
This error indicates failure to fetch a specific record from a user's PDS. The record may exist but be inaccessible, or may not exist at all.
Example
try {
const record = await repository.getRecord(uri);
} catch (error) {
if (error instanceof RecordFetchError) {
logger.warn('Record fetch failed', { uri: error.uri, reason: error.reason });
}
}
Extends
Constructors
new RecordFetchError()
new RecordFetchError(
message,uri,reason,cause?):RecordFetchError
Defined in: src/atproto/errors/repository-errors.ts:175
Creates a new RecordFetchError.
Parameters
message
string
Description of the fetch failure
uri
string
AT URI of the record
reason
Specific reason for failure
"not_found" | "network_error" | "pds_error" | "parse_error"
cause?
Error
Original error (if chained)
Returns
Overrides
Properties
cause?
readonlyoptionalcause: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
code
readonlycode:"RECORD_FETCH_ERROR"='RECORD_FETCH_ERROR'
Defined in: src/atproto/errors/repository-errors.ts:155
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
reason
readonlyreason:"not_found"|"network_error"|"pds_error"|"parse_error"
Defined in: src/atproto/errors/repository-errors.ts:165
Reason for fetch failure.
uri
readonlyuri:string
Defined in: src/atproto/errors/repository-errors.ts:160
AT URI of the record that failed to fetch.