fmt(js): `npm run fix` on merge (#83539)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
e5e2fb8b2d
commit
a1bfbccc02
|
|
@ -30,6 +30,7 @@ describe('attachRendererConsoleCapture', () => {
|
|||
it('logs error-level messages and skips the rest', () => {
|
||||
const log = vi.fn()
|
||||
let handler: ((...args: unknown[]) => void) | undefined
|
||||
|
||||
const win = {
|
||||
webContents: {
|
||||
on: (_event: string, listener: (...args: unknown[]) => void) => {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ export function formatRendererConsoleLine(
|
|||
): string | null {
|
||||
const details =
|
||||
detailsOrLevel && typeof detailsOrLevel === 'object' ? (detailsOrLevel as ConsoleMessageDetails) : null
|
||||
|
||||
const level = details ? details.level : detailsOrLevel
|
||||
|
||||
if (level !== 3) {
|
||||
|
|
@ -84,6 +85,7 @@ export function formatRendererBoundaryReport(
|
|||
const head = `[renderer crash:${clamp(label, 64) || 'unknown'}] [error-boundary:${clamp(boundary, 64) || 'unknown'}] ${
|
||||
clamp(message, 2000) || '(no message)'
|
||||
}`
|
||||
|
||||
const stack = clamp(componentStack, 4000).trim()
|
||||
|
||||
return stack ? `${head}\n${stack}` : head
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
|
|||
const label = this.props.label ?? ''
|
||||
const tag = label ? `[error-boundary:${label}]` : '[error-boundary]'
|
||||
console.error(tag, error, info.componentStack)
|
||||
|
||||
// Persist to desktop.log via Electron (#79428): console.error only reaches
|
||||
// the main process for windows with a console hook, is minified, and loses
|
||||
// the component stack. This survives the window and names the component.
|
||||
|
|
@ -66,6 +67,7 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
|
|||
} catch {
|
||||
// Logging must never take the boundary down with it.
|
||||
}
|
||||
|
||||
this.props.onError?.(error, info)
|
||||
|
||||
if (this.props.label === 'root' && isTransientAssistantUiLookupError(error) && this.takeAutoRecoveryAttempt()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue