@did-space/core 1.1.33 → 1.1.34

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.
@@ -176,7 +176,8 @@ class ObjectSpace extends events_1.default {
176
176
  debug('getHash.$key', key);
177
177
  debug('getHash.$where', JSON.stringify({ where }));
178
178
  if (!(yield this.exists(options))) {
179
- throw new Error(`Object(${key}) not exists`);
179
+ utils_1.logger.error('getHash.$key', `Object(${key}) not exists`);
180
+ throw new Error('Object not exists');
180
181
  }
181
182
  const tree = yield this.options.treeRepository.findOne({
182
183
  where,
@@ -184,7 +185,8 @@ class ObjectSpace extends events_1.default {
184
185
  raw: true,
185
186
  });
186
187
  if (!tree) {
187
- throw new Error(`Object(${key}) not exists`);
188
+ utils_1.logger.error('getHash.$tree', `Object(${key}) not exists`);
189
+ throw new Error('Object not exists');
188
190
  }
189
191
  return tree.objectId;
190
192
  });
@@ -587,7 +589,8 @@ class ObjectSpace extends events_1.default {
587
589
  raw: true,
588
590
  });
589
591
  if (!(tree === null || tree === void 0 ? void 0 : tree.objectId)) {
590
- throw new Error(`Object(${key}) not exists`);
592
+ utils_1.logger.error('readAsOwner.$tree', `Object(${key}) not exists`);
593
+ throw new Error('Object not exists');
591
594
  }
592
595
  return this.driver.readAsOwner((0, utils_1.getHashPath)(tree.objectId), {
593
596
  useGlobal: true,
@@ -146,7 +146,8 @@ export class ObjectSpace extends EventEmitter {
146
146
  debug('getHash.$key', key);
147
147
  debug('getHash.$where', JSON.stringify({ where }));
148
148
  if (!(await this.exists(options))) {
149
- throw new Error(`Object(${key}) not exists`);
149
+ logger.error('getHash.$key', `Object(${key}) not exists`);
150
+ throw new Error('Object not exists');
150
151
  }
151
152
  const tree = await this.options.treeRepository.findOne({
152
153
  where,
@@ -154,7 +155,8 @@ export class ObjectSpace extends EventEmitter {
154
155
  raw: true,
155
156
  });
156
157
  if (!tree) {
157
- throw new Error(`Object(${key}) not exists`);
158
+ logger.error('getHash.$tree', `Object(${key}) not exists`);
159
+ throw new Error('Object not exists');
158
160
  }
159
161
  return tree.objectId;
160
162
  }
@@ -552,7 +554,8 @@ export class ObjectSpace extends EventEmitter {
552
554
  raw: true,
553
555
  });
554
556
  if (!tree?.objectId) {
555
- throw new Error(`Object(${key}) not exists`);
557
+ logger.error('readAsOwner.$tree', `Object(${key}) not exists`);
558
+ throw new Error('Object not exists');
556
559
  }
557
560
  return this.driver.readAsOwner(getHashPath(tree.objectId), {
558
561
  useGlobal: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@did-space/core",
3
- "version": "1.1.33",
3
+ "version": "1.1.34",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -111,7 +111,7 @@
111
111
  "@arcblock/did": "^1.25.6",
112
112
  "@arcblock/ipfs-only-hash": "^0.0.2",
113
113
  "@arcblock/validator": "^1.25.6",
114
- "@did-space/constants": "^1.1.33",
114
+ "@did-space/constants": "^1.1.34",
115
115
  "dayjs": "^1.11.13",
116
116
  "debug": "^4.4.1",
117
117
  "destroy": "^1.2.0",
@@ -142,5 +142,5 @@
142
142
  "vite": "^7.0.0",
143
143
  "vitest": "^3.2.4"
144
144
  },
145
- "gitHead": "90e1f5ceb7ed703bee6f490a3ea6ae17559f8b49"
145
+ "gitHead": "b39737033011ba67a85e64cc30e59e5a9ecba626"
146
146
  }