How to use the @tanker/datastore-base.errors.RecordNotFound function in @tanker/datastore-base

To help you get started, we’ve selected a few @tanker/datastore-base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TankerHQ / sdk-js / packages / datastore / pouchdb-base / src / index.js View on Github external
get = async (table: string, id: string) => {
    try {
      return fromDB(await this._dbs[table].get(id));
    } catch (e) {
      if (e.status === 404) {
        throw new dbErrors.RecordNotFound(e);
      } else {
        throw new dbErrors.UnknownError(e);
      }
    }
  }

@tanker/datastore-base

Tanker SDK (datastore base)

Apache-2.0
Latest version published 3 months ago

Package Health Score

65 / 100
Full package analysis

Similar packages