website refactor
This commit is contained in:
@@ -78,7 +78,7 @@ export class ErrorReplaySystem {
|
||||
status: log.response?.status,
|
||||
error: log.error?.message,
|
||||
})),
|
||||
reactErrors: (window as any).__GRIDPILOT_REACT_ERRORS__?.slice(-5).map((e: any) => ({
|
||||
reactErrors: (window as { __GRIDPILOT_REACT_ERRORS__?: Array<{ error?: { message?: string }; componentStack?: string }> }).__GRIDPILOT_REACT_ERRORS__?.slice(-5).map((e) => ({
|
||||
message: e.error?.message || 'Unknown React error',
|
||||
componentStack: e.componentStack,
|
||||
})) || [],
|
||||
@@ -176,14 +176,13 @@ export class ErrorReplaySystem {
|
||||
console.log('Metadata:', replay.metadata);
|
||||
|
||||
// Recreate the error
|
||||
const error = replay.error.type === 'ApiError'
|
||||
const error = replay.error.type === 'ApiError'
|
||||
? new ApiError(
|
||||
replay.error.message,
|
||||
(replay.error.context as any)?.type || 'UNKNOWN_ERROR',
|
||||
((replay.error.context as { type?: string } | undefined)?.type as import('../api/base/ApiError').ApiErrorType) || 'UNKNOWN_ERROR',
|
||||
{
|
||||
timestamp: replay.timestamp,
|
||||
...(replay.error.context as any),
|
||||
replayId: replay.metadata.replayId,
|
||||
...(replay.error.context as Record<string, unknown> | undefined),
|
||||
}
|
||||
)
|
||||
: new Error(replay.error.message);
|
||||
|
||||
Reference in New Issue
Block a user