@onehat/data 1.20.5 → 1.20.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.20.5",
3
+ "version": "1.20.6",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -2225,7 +2225,11 @@ export default class Repository extends EventEmitter {
2225
2225
  this.errorHandler(obj, data);
2226
2226
  } else {
2227
2227
  this.emit('error', obj, data);
2228
- throw Error(obj, data);
2228
+ let message = obj;
2229
+ if (data) {
2230
+ message = JSON.stringify({ obj, data });
2231
+ }
2232
+ throw Error(message);
2229
2233
  }
2230
2234
  }
2231
2235