@anzusystems/common-admin 1.47.0-beta.dev-1771894840 → 1.47.0-beta.dev-1771894841
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/common-admin.d.ts
CHANGED
|
@@ -18839,8 +18839,8 @@ export declare const ANotFoundView: DefineComponent<__VLS_Props_105, {}, {}, {},
|
|
|
18839
18839
|
* Custom error class for Axios-related errors
|
|
18840
18840
|
*/
|
|
18841
18841
|
export declare class AnzuApiAxiosError extends Error {
|
|
18842
|
-
cause: AxiosError
|
|
18843
|
-
constructor(cause: AxiosError);
|
|
18842
|
+
cause: AxiosError<any, any>;
|
|
18843
|
+
constructor(cause: AxiosError<any, any>);
|
|
18844
18844
|
}
|
|
18845
18845
|
|
|
18846
18846
|
export declare class AnzuApiDependencyExistsError extends Error {
|
package/package.json
CHANGED
package/src/eslint/plugin.mjs
CHANGED
|
@@ -272,6 +272,13 @@ const anzuPlugin = {
|
|
|
272
272
|
const hasFatalCheck = parts.some(
|
|
273
273
|
(part) => part.type === 'CallExpression' && part.callee.name === 'isAnzuFatalError'
|
|
274
274
|
)
|
|
275
|
+
const hasInstanceofErrorCheck = parts.some(
|
|
276
|
+
(part) =>
|
|
277
|
+
part.type === 'BinaryExpression' &&
|
|
278
|
+
part.operator === 'instanceof' &&
|
|
279
|
+
part.right.type === 'Identifier' &&
|
|
280
|
+
part.right.name === 'Error'
|
|
281
|
+
)
|
|
275
282
|
const hasAxiosCheck = parts.some(
|
|
276
283
|
(part) =>
|
|
277
284
|
part.type === 'CallExpression' &&
|
|
@@ -280,11 +287,11 @@ const anzuPlugin = {
|
|
|
280
287
|
part.callee.property.name === 'isAxiosError'
|
|
281
288
|
)
|
|
282
289
|
|
|
283
|
-
if (
|
|
290
|
+
if (hasAxiosCheck && (hasFatalCheck || hasInstanceofErrorCheck)) {
|
|
284
291
|
context.report({
|
|
285
292
|
node,
|
|
286
293
|
message:
|
|
287
|
-
'Replace
|
|
294
|
+
'Replace error type check && axios.isAxiosError(error.cause)' +
|
|
288
295
|
' with isAnzuApiAxiosError(error).' +
|
|
289
296
|
' Labs API throws AnzuApiAxiosError with typed AxiosError cause.',
|
|
290
297
|
})
|