Skip to contents

Every error dastash raises inherits from dastash_error, and from exactly one class that says what went wrong. Catch the specific class to tell "compute it again" apart from "the store is broken":

ClassRaised when
dastash_key_invalidAn object the key encoding does not cover; a partially named vector; an anonymous memoised function without name
dastash_not_foundA read of an absent or expired key without default; stash() with create = FALSE on a missing directory
dastash_type_errorA counter operation on a non-counter or past 2^53; a path or lazy read of an entry of the wrong shape; a value a codec cannot store; an expire that is NA or NaN
dastash_codec_errorEncoding or decoding failed; a codec's package is not installed; a record names a codec the handle does not know
dastash_blob_corruptA read finds the file behind a record missing, or not the size its record holds
dastash_busyThe write lock was not acquired within timeout
dastash_store_fullThe database reached its map_size
dastash_readonlyA write on a read-only handle
dastash_config_conflictAn explicit store-level setting disagrees with the stored one
dastash_version_unsupportedThe store was written by a newer format or key encoding
dastash_forkedA handle used in a process that did not open it
dastash_closedA verb on a closed handle
dastash_unsupportedThe platform or this release cannot do it
dastash_engine_errorAny other failure of the storage engine, with the original condition as parent

Conditions carry structured fields where they apply, such as key, dir, path and codec, so a handler can act on them without parsing the message.

dastash raises one warning, of class dastash_memoise_unstored and dastash_warning: a memoised function computed a result but the stash was busy, full or read-only, so it was returned without being stored. Its parent is the error that prevented storing it.