@jd-data-limited/easy-fm 0.0.8 → 0.0.9

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.
Files changed (2) hide show
  1. package/index.js +3 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -24,8 +24,7 @@ import * as https from "https";
24
24
  // @ts-ignore
25
25
  const errs = JSON.parse(fs.readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), 'fmErrors.json')).toString());
26
26
  export default class FileMakerConnection {
27
- constructor() {
28
- }
27
+ constructor() { }
29
28
  get endpoint() {
30
29
  return `https://${this.hostname}/fmi/data/v2/databases/${encodeURI(this.database)}`;
31
30
  }
@@ -490,11 +489,11 @@ class find {
490
489
  }
491
490
  export class FMError extends Error {
492
491
  constructor(code, httpStatus, res) {
493
- super(code);
492
+ super(errs.find(err => err.e === this.code) || "Unknown error");
494
493
  this.httpStatus = httpStatus;
495
494
  this.res = res;
496
495
  this.code = typeof code === "string" ? parseInt(code) : code;
497
- this.message = errs.find(err => err.e === this.code) || "Unknown error";
496
+ Error.captureStackTrace(this, FMError);
498
497
  }
499
498
  }
500
499
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jd-data-limited/easy-fm",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "dependencies": {
5
5
  "@types/btoa": "^1.2.3",
6
6
  "@types/events": "^3.0.0",