Skip to content

fix(core): preserve request error messages without stacks - #4092

Open
lprnmns wants to merge 1 commit into
apify:masterfrom
lprnmns:codex/fix-4087-error-message-fallback
Open

fix(core): preserve request error messages without stacks#4092
lprnmns wants to merge 1 commit into
apify:masterfrom
lprnmns:codex/fix-4087-error-message-fallback

Conversation

@lprnmns

@lprnmns lprnmns commented Aug 31, 2026

Copy link
Copy Markdown

What does this PR do?

Request.pushErrorMessage() can append null or undefined when an Error has no stack. errorMessages is a persisted string[], so the invalid entry can make request reconstruction/persistence fail.

When a stack is unavailable, preserve the existing message as the fallback. This keeps stack-rich errors unchanged and prevents malformed error-message arrays.

Fixes #4087

Testing

  • corepack pnpm exec vitest run test/core/request.test.ts --coverage.enabled=false
  • corepack pnpm exec oxfmt --check packages/core/src/request.ts test/core/request.test.ts
  • corepack pnpm exec oxlint packages/core/src/request.ts test/core/request.test.ts --tsconfig=tsconfig.json --type-aware

The full test TypeScript check was also attempted; it is currently blocked in a pristine checkout by pre-existing missing generated @crawlee/*/dist declarations and unrelated strictness errors.

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.

Request.pushErrorMessage stores null when Error.stack is missing, poisoning persisted requests

3 participants