Skip to content

Commit 413c35a

Browse files
committed
fix: resolve TypeScript type errors in errorHandler and ImageItem
1 parent e382e92 commit 413c35a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/types/image.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export interface ImageItem {
55
desc: string;
66
country: string;
77
isLoading: boolean;
8+
shouldLoad?: boolean;
89
}

src/utils/errorHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export class AppError extends Error {
1010
) {
1111
super(message);
1212
this.name = 'AppError';
13-
// 保持堆栈跟踪
14-
if (Error.captureStackTrace) {
15-
Error.captureStackTrace(this, AppError);
13+
// 保持堆栈跟踪 (V8/Node.js specific)
14+
if (typeof (Error as any).captureStackTrace === 'function') {
15+
(Error as any).captureStackTrace(this, AppError);
1616
}
1717
}
1818
}

0 commit comments

Comments
 (0)