Error catalog

Every typed error class the store throws, harvested from the source at boot - 7 classes, 6 stable codes. Each carries a frozen string code: catch once with err instanceof StashError and branch on err.code, never on message text.

Error classes

ClassCodeExtendsDescriptionDeclared in
StashErrorErrorBase class for every StashJS error. Carries a stable string code; subclasses fix the code and a capability-free default message.src/errors.js
IntegrityErrorEINTEGRITYStashErrorBlob bytes no longer match the recorded digest. Code: EINTEGRITY.src/errors.js
InvalidRefEBADREFStashErrorMalformed ref string; refused before any storage access. Code: EBADREF.src/errors.js
RefClaimedECLAIMEDStashErrorA concurrent pop already claimed the entry. Code: ECLAIMED.src/errors.js
RefNotFoundENOREFStashErrorUnknown or expired ref. Code: ENOREF.src/errors.js
SizeExceededE2BIGStashErrormaxSize crossed mid-stream. Code: E2BIG.src/errors.js
StashFullEFULLStashErrormaxEntries / maxTotal reached; the push was refused. Code: EFULL.src/errors.js

No error message ever contains a ref, a meta value, or a filesystem path - a ref is a capability, and an error that echoes a capability into a log file has leaked it.