Class: IdentityResolutionError
Defined in: src/atproto/errors/repository-errors.ts:96
Error thrown when DID resolution fails.
Remarks
This error indicates failure to resolve a DID to its DID document or to extract the PDS endpoint from the DID document. Common causes include:
- Invalid DID format
- DID method not supported (only did:plc and did:web)
- PLC directory unreachable
- DID document missing PDS service entry
Example
try {
const pdsUrl = await identity.getPDSEndpoint(did);
} catch (error) {
if (error instanceof IdentityResolutionError) {
logger.error('Cannot resolve DID', { did: error.did, reason: error.reason });
}
}
Extends
Constructors
new IdentityResolutionError()
new IdentityResolutionError(
message,did,reason,cause?):IdentityResolutionError
Defined in: src/atproto/errors/repository-errors.ts:122
Creates a new IdentityResolutionError.
Parameters
message
string
Description of the resolution failure
did
string
DID that failed to resolve
reason
Specific reason for failure
"invalid_format" | "unsupported_method" | "not_found" | "network_error" | "no_pds"
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:"IDENTITY_RESOLUTION_ERROR"='IDENTITY_RESOLUTION_ERROR'
Defined in: src/atproto/errors/repository-errors.ts:97
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
did
readonlydid:string
Defined in: src/atproto/errors/repository-errors.ts:102
DID that failed to resolve.
reason
readonlyreason:"invalid_format"|"unsupported_method"|"not_found"|"network_error"|"no_pds"
Defined in: src/atproto/errors/repository-errors.ts:107
Reason for resolution failure.