@equos/node-sdk 0.0.11 → 0.0.14

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/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './equos';
2
+ export * from './types/error.type';
package/dist/index.js CHANGED
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./equos"), exports);
18
+ __exportStar(require("./types/error.type"), exports);
@@ -1,5 +1,5 @@
1
1
  import { EquosError } from '../types/error.type';
2
2
  export declare class ErrorUtils {
3
3
  static UNKNOWN_ERROR: EquosError;
4
- static convertToEquosError(e: unknown): never;
4
+ static convertToEquosError(e: any): never;
5
5
  }
@@ -1,18 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ErrorUtils = void 0;
4
- const axios_1 = require("axios");
5
4
  const error_type_1 = require("../types/error.type");
6
5
  class ErrorUtils {
7
6
  static UNKNOWN_ERROR = new error_type_1.EquosError('An unknown error occurred', 'UNKNOWN_ERROR');
8
7
  static convertToEquosError(e) {
9
- if (e instanceof axios_1.AxiosError) {
10
- throw new error_type_1.EquosError(e.response?.data?.message, e.code);
11
- }
12
- else if (e instanceof Error) {
13
- throw new error_type_1.EquosError(e.message);
14
- }
15
- throw ErrorUtils.UNKNOWN_ERROR;
8
+ throw new error_type_1.EquosError(e.response?.data?.message || e.message || 'An unknown error occured.', e.code);
16
9
  }
17
10
  }
18
11
  exports.ErrorUtils = ErrorUtils;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equos/node-sdk",
3
- "version": "0.0.11",
3
+ "version": "0.0.14",
4
4
  "description": "Equos.ai node.js official SDK.",
5
5
  "keywords": [
6
6
  "ai",