Skip to content

telemetry(crash): name the step a crash happened in - #24

Merged
lars-1987 merged 1 commit into
mainfrom
telemetry/crash-step
Nov 1, 2026
Merged

lars-1987 merged 1 commit into
mainfrom
telemetry/crash-step

Conversation

@lars-1987

Copy link
Copy Markdown
Owner

Summary

Crash reasons now say where the crash happened.

 processFile
+  step = "read"
   file.arrayBuffer()
+  step = "strip"
   entry.strip(bytes, options, at)     # a processor may call at("...")
+  step = "assemble"
   assemble()
 catch
-  reason = `crash: ${name}`
+  reason = `crash: ${name} at ${step}`

stripPdf marks info:<Key> for each Info field, then xmp, custom and save. Other formats report read, strip or assemble until they mark their own.

Steps are fixed strings from our code, so the reason still never carries text from the file.

Evidence

  • Before: a PDF whose CreationDate is Monday, 5 January gives crash: Error. That is the same reason as the production failures on 6 and 31 Oct.
    After: the same file gives crash: Error at info:CreationDate.
pdf with an unparsable CreationDate  -> "crash: Error at info:CreationDate"
pdf with text in ModDate             -> "crash: Error at info:ModDate", no file text in the reason
failed full read                     -> "crash: NotFoundError at read"
heic with a bad iloc count           -> "crash: RangeError at strip"

305 tests pass, typecheck and lint clean.

Merge Danger

Door: two-way

Blast Radius: telemetry

No user-facing change. The crash reason string changes, so queries matching exactly crash: Error need ILIKE 'crash%'. The malformed date crash itself is not fixed here.

pdf-lib's errors are all named plain "Error", so every PDF crash reported
the same `crash: Error`, and telemetry couldn't say where it failed.

processFile now tracks a step (read, strip, assemble) and any processor can
refine it. stripPdf names the Info field, xmp, custom and save. Steps are
fixed names from our own code, never text from the file.

@lars-1987 lars-1987 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@lars-1987
lars-1987 merged commit 12f5d4f into main Nov 1, 2026
1 check passed
@lars-1987
lars-1987 deleted the telemetry/crash-step branch November 1, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant