@gravity-ui/charts 0.4.0 → 0.4.1

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.
@@ -10,7 +10,7 @@ export declare const CHART_ERROR_CODE: {
10
10
  };
11
11
  export declare class ChartError extends Error {
12
12
  readonly code: number | string;
13
- readonly isChartError = true;
13
+ readonly isCustomError = true;
14
14
  constructor({ originalError, message, code }?: ChartErrorArgs);
15
15
  }
16
- export declare const isChartError: (error: unknown) => error is ChartError;
16
+ export declare const isCustomError: (error: unknown) => error is ChartError;
@@ -1,12 +1,12 @@
1
1
  export const CHART_ERROR_CODE = {
2
- NO_DATA: 'NO_DATA',
3
- INVALID_DATA: 'INVALID_DATA',
4
- UNKNOWN: 'UNKNOWN_ERROR',
2
+ NO_DATA: 'ERR.CK.NO_DATA',
3
+ INVALID_DATA: 'ERR.CK.INVALID_DATA',
4
+ UNKNOWN: 'ERR.CK.UNKNOWN_ERROR',
5
5
  };
6
6
  export class ChartError extends Error {
7
7
  constructor({ originalError, message, code = CHART_ERROR_CODE.UNKNOWN } = {}) {
8
8
  super(message);
9
- this.isChartError = true;
9
+ this.isCustomError = true;
10
10
  this.code = code;
11
11
  if (originalError) {
12
12
  this.name = originalError.name;
@@ -14,6 +14,6 @@ export class ChartError extends Error {
14
14
  }
15
15
  }
16
16
  }
17
- export const isChartError = (error) => {
18
- return error instanceof Error && 'isChartError' in error;
17
+ export const isCustomError = (error) => {
18
+ return error instanceof Error && 'isCustomError' in error;
19
19
  };
@@ -10,7 +10,7 @@ export declare const CHART_ERROR_CODE: {
10
10
  };
11
11
  export declare class ChartError extends Error {
12
12
  readonly code: number | string;
13
- readonly isChartError = true;
13
+ readonly isCustomError = true;
14
14
  constructor({ originalError, message, code }?: ChartErrorArgs);
15
15
  }
16
- export declare const isChartError: (error: unknown) => error is ChartError;
16
+ export declare const isCustomError: (error: unknown) => error is ChartError;
@@ -1,12 +1,12 @@
1
1
  export const CHART_ERROR_CODE = {
2
- NO_DATA: 'NO_DATA',
3
- INVALID_DATA: 'INVALID_DATA',
4
- UNKNOWN: 'UNKNOWN_ERROR',
2
+ NO_DATA: 'ERR.CK.NO_DATA',
3
+ INVALID_DATA: 'ERR.CK.INVALID_DATA',
4
+ UNKNOWN: 'ERR.CK.UNKNOWN_ERROR',
5
5
  };
6
6
  export class ChartError extends Error {
7
7
  constructor({ originalError, message, code = CHART_ERROR_CODE.UNKNOWN } = {}) {
8
8
  super(message);
9
- this.isChartError = true;
9
+ this.isCustomError = true;
10
10
  this.code = code;
11
11
  if (originalError) {
12
12
  this.name = originalError.name;
@@ -14,6 +14,6 @@ export class ChartError extends Error {
14
14
  }
15
15
  }
16
16
  }
17
- export const isChartError = (error) => {
18
- return error instanceof Error && 'isChartError' in error;
17
+ export const isCustomError = (error) => {
18
+ return error instanceof Error && 'isCustomError' in error;
19
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/charts",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "React component used to render charts",
5
5
  "license": "MIT",
6
6
  "main": "dist/cjs/index.js",