UNPKG

@atproto/repo

Version:

atproto repo and MST implementation

34 lines 1.04 kB
export class MissingBlockError extends Error { constructor(cid, def) { let msg = `block not found: ${cid.toString()}`; if (def) { msg += `, expected type: ${def}`; } super(msg); this.cid = cid; } } export class MissingBlocksError extends Error { constructor(context, cids) { const cidStr = cids.map((c) => c.toString()); super(`missing ${context} blocks: ${cidStr}`); this.context = context; this.cids = cids; } } export class MissingCommitBlocksError extends Error { constructor(commit, cids) { const cidStr = cids.map((c) => c.toString()); super(`missing blocks for commit ${commit.toString()}: ${cidStr}`); this.commit = commit; this.cids = cids; } } export class UnexpectedObjectError extends Error { constructor(cid, def) { super(`unexpected object at ${cid.toString()}, expected: ${def}`); this.cid = cid; this.def = def; } } //# sourceMappingURL=error.js.map