@fireproof/core 0.20.2 → 0.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -2085,12 +2085,14 @@ var DatabaseImpl = class {
2085
2085
  if (!id) throw this.logger.Error().Str("db", this.name).Msg(`Doc id is required`).AsError();
2086
2086
  await this.ready();
2087
2087
  this.logger.Debug().Str("id", id).Msg("get");
2088
- const got = await this.ledger.crdt.get(id).catch((e) => {
2089
- throw new NotFoundError(`Not found: ${id} - ${e.message}`);
2090
- });
2091
- if (!got) throw new NotFoundError(`Not found: ${id}`);
2092
- const { doc } = got;
2093
- return { ...doc, _id: id };
2088
+ try {
2089
+ const got = await this.ledger.crdt.get(id);
2090
+ if (!got) throw new NotFoundError(`Not found: ${id}`);
2091
+ const { doc } = got;
2092
+ return { ...doc, _id: id };
2093
+ } catch (e) {
2094
+ throw new NotFoundError(`Not found: ${id} - ${e instanceof Error ? e.message : String(e)}`);
2095
+ }
2094
2096
  }
2095
2097
  async put(doc) {
2096
2098
  await this.ready();
@@ -7218,7 +7220,7 @@ function buildResDelWAL(msgCtx, req, ctx) {
7218
7220
 
7219
7221
  // src/version.ts
7220
7222
  var PACKAGE_VERSION = Object.keys({
7221
- "0.20.2": "xxxx"
7223
+ "0.20.3": "xxxx"
7222
7224
  })[0];
7223
7225
  export {
7224
7226
  CRDTImpl,