diff --git a/docs/reports/public/assets/report.css b/docs/reports/public/assets/report.css index d609e7d..8fceecb 100644 --- a/docs/reports/public/assets/report.css +++ b/docs/reports/public/assets/report.css @@ -18,7 +18,7 @@ html { body { margin: 7% auto 0; - max-width: 400px; + max-width: 405px; min-height: 180px; padding: 30px 0 15px; } diff --git a/docs/reports/src/view.tsx b/docs/reports/src/view.tsx index f370f94..48a22c0 100644 --- a/docs/reports/src/view.tsx +++ b/docs/reports/src/view.tsx @@ -8,6 +8,27 @@ function formatBytes(value: number | null): string { return `${value}b`; } +function crashDetail(code: string): string { + switch (code) { + case 'SIGSEGV': + case 'EXCEPTION_ACCESS_VIOLATION': + return 'Invalid memory access'; + case 'SIGBUS': + return 'Bus error'; + case 'SIGFPE': + return 'Floating point exception'; + case 'SIGILL': + case 'EXCEPTION_ILLEGAL_INSTRUCTION': + return 'Illegal instruction'; + case 'SIGABRT': + return 'Abort'; + case 'EXCEPTION_STACK_OVERFLOW': + return 'Stack overflow'; + default: + return 'Fatal error'; + } +} + const Shell = ({ title, children }: { title: string; children: Child }) => ( @@ -37,58 +58,62 @@ const BlankPage = () => ( ); -const ReportPage = ({ report, url }: { report: CrashReport; url: string }) => ( - - -

- {report.reason}.{' '} - - {report.code} at {report.addr} - -
- Ant crashed and sent a redacted report. -

+const ReportPage = ({ report, url }: { report: CrashReport; url: string }) => { + const detail = crashDetail(report.code); -
-

- Runtime: Ant {report.version} -

-

- Platform: {report.os} {report.arch} -

+ return ( + +

- Target: {report.target} + {report.reason}.{' '} + + {detail} at {report.addr} + +
+ Ant crashed and sent a redacted report.

-

- Elapsed: {report.elapsedMs ?? 'unknown'}ms -

-

- Peak RSS: {formatBytes(report.peakRss)} -

-
-
- Native backtrace: -
    - {report.frames.length ? ( - report.frames.map(frame => ( +
    +

    + Runtime: Ant {report.version} +

    +

    + Platform: {report.os} {report.arch} +

    +

    + Target: {report.target} +

    +

    + Elapsed: {report.elapsedMs ?? 'unknown'}ms +

    +

    + Peak RSS: {formatBytes(report.peakRss)} +

    +
    + +
    + Native backtrace: +
      + {report.frames.length ? ( + report.frames.map(frame => ( +
    1. + {frame} +
    2. + )) + ) : (
    3. - {frame} + No native frames were captured.
    4. - )) - ) : ( -
    5. - No native frames were captured. -
    6. - )} -
    -
    + )} +
+
-

- This report URL: {url} -

-
-); +

+ This report URL: {url} +

+ + ); +}; export function renderBlank(): string { return `${()}`;