fix(core): #trunc test case
MODIFY
packages/core/src/+internal/utils/error.util.ts
packages/core/src/+internal/utils/error.util.ts
@@ -4,5 +4,8 @@ export class ExtendableError extends Error {
}
}
+export const isExtendableError = (data: any): data is ExtendableError =>
+ !!data?.name && !!data?.message;
+
export const isError = (data: any): data is Error =>
!!data?.stack && !!data?.name;

MODIFY
packages/core/src/error/error.model.ts
packages/core/src/error/error.model.ts
@@ -39,8 +39,8 @@ export class EventError extends ExtendableError {
}
}
-export const isCoreError = (error: Error): error is CoreError =>
- error.name === ErrorType.CORE_ERROR;
+export const isCoreError = (error: Error | undefined): error is CoreError =>
+ error?.name === ErrorType.CORE_ERROR;
-export const isEventError = (error: Error): error is EventError =>
- error.name === ErrorType.EVENT_ERROR;
+export const isEventError = (error: Error | undefined): error is EventError =>
+ error?.name === ErrorType.EVENT_ERROR;

fix(core): #trunc test case