@takeshape/errors 9.94.10 → 9.96.3
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.
|
@@ -12,5 +12,9 @@ export declare class InvalidPaginationTypeError extends ApiIndexingError {
|
|
|
12
12
|
static code: string;
|
|
13
13
|
constructor(validTypes: string[]);
|
|
14
14
|
}
|
|
15
|
-
export declare
|
|
15
|
+
export declare class IndexItemMissingIdError extends ApiIndexingError {
|
|
16
|
+
static code: string;
|
|
17
|
+
constructor(idFieldName: string);
|
|
18
|
+
}
|
|
19
|
+
export declare function apiIndexingLogErrorMessage(shapeName: string, error?: Error): string;
|
|
16
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api-indexing/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,WAAW,CAAC;AAExC,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,OAAc,IAAI,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;gBAED,OAAO,EAAE,MAAM;CAInC;AAED,qBAAa,wBAAyB,SAAQ,gBAAgB;IAC5D,OAAc,IAAI,SAA8B;gBAE7B,SAAS,EAAE,MAAM;CAGrC;AAED,qBAAa,0BAA2B,SAAQ,gBAAgB;IAC9D,OAAc,IAAI,SAAgC;gBAE/B,UAAU,EAAE,MAAM,EAAE;CAGxC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api-indexing/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,WAAW,CAAC;AAExC,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,OAAc,IAAI,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;gBAED,OAAO,EAAE,MAAM;CAInC;AAED,qBAAa,wBAAyB,SAAQ,gBAAgB;IAC5D,OAAc,IAAI,SAA8B;gBAE7B,SAAS,EAAE,MAAM;CAGrC;AAED,qBAAa,0BAA2B,SAAQ,gBAAgB;IAC9D,OAAc,IAAI,SAAgC;gBAE/B,UAAU,EAAE,MAAM,EAAE;CAGxC;AAED,qBAAa,uBAAwB,SAAQ,gBAAgB;IAC3D,OAAc,IAAI,SAA6B;gBAE5B,WAAW,EAAE,MAAM;CAKvC;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAInF"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.MissingIndexedShapeError = exports.InvalidPaginationTypeError = exports.ApiIndexingError = void 0;
|
|
6
|
+
exports.MissingIndexedShapeError = exports.InvalidPaginationTypeError = exports.IndexItemMissingIdError = exports.ApiIndexingError = void 0;
|
|
7
7
|
exports.apiIndexingLogErrorMessage = apiIndexingLogErrorMessage;
|
|
8
8
|
var _es6Error = _interopRequireDefault(require("es6-error"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -33,13 +33,13 @@ class InvalidPaginationTypeError extends ApiIndexingError {
|
|
|
33
33
|
}
|
|
34
34
|
exports.InvalidPaginationTypeError = InvalidPaginationTypeError;
|
|
35
35
|
_defineProperty(InvalidPaginationTypeError, "code", 'InvalidPaginationTypeError');
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} = error;
|
|
41
|
-
return code !== undefined && knownErrorCodes.has(code);
|
|
36
|
+
class IndexItemMissingIdError extends ApiIndexingError {
|
|
37
|
+
constructor(idFieldName) {
|
|
38
|
+
super(`Index item is missing a value for the id field "${idFieldName}". Please make sure that cache.idField is set correctly.`);
|
|
39
|
+
}
|
|
42
40
|
}
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
exports.IndexItemMissingIdError = IndexItemMissingIdError;
|
|
42
|
+
_defineProperty(IndexItemMissingIdError, "code", 'IndexItemMissingIdError');
|
|
43
|
+
function apiIndexingLogErrorMessage(shapeName, error) {
|
|
44
|
+
return error instanceof ApiIndexingError ? error.message : `Failed to index shape "${shapeName}" due to an unexpected error.`;
|
|
45
45
|
}
|
package/es/api-indexing/index.js
CHANGED
|
@@ -22,13 +22,12 @@ export class InvalidPaginationTypeError extends ApiIndexingError {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
_defineProperty(InvalidPaginationTypeError, "code", 'InvalidPaginationTypeError');
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = error;
|
|
30
|
-
return code !== undefined && knownErrorCodes.has(code);
|
|
25
|
+
export class IndexItemMissingIdError extends ApiIndexingError {
|
|
26
|
+
constructor(idFieldName) {
|
|
27
|
+
super(`Index item is missing a value for the id field "${idFieldName}". Please make sure that cache.idField is set correctly.`);
|
|
28
|
+
}
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
_defineProperty(IndexItemMissingIdError, "code", 'IndexItemMissingIdError');
|
|
31
|
+
export function apiIndexingLogErrorMessage(shapeName, error) {
|
|
32
|
+
return error instanceof ApiIndexingError ? error.message : `Failed to index shape "${shapeName}" due to an unexpected error.`;
|
|
34
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/errors",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.96.3",
|
|
4
4
|
"description": "Custom error objects.",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"ajv": "^8.10.0",
|
|
24
|
-
"@takeshape/typescript-jest-junit-reporter": "9.
|
|
24
|
+
"@takeshape/typescript-jest-junit-reporter": "9.96.3"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=16"
|