Skip to content

fix(vm): categorize user or server side errors#4283

Draft
TheodoreSpeaks wants to merge 1 commit intostagingfrom
fix/docx-preview-failure
Draft

fix(vm): categorize user or server side errors#4283
TheodoreSpeaks wants to merge 1 commit intostagingfrom
fix/docx-preview-failure

Conversation

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator

Summary

Brief description of what this PR does and why.

Fixes #(issue)

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

How has this been tested? What should reviewers focus on?

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 24, 2026 0:30am

Request Review

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator Author

@BugBot review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 24, 2026

PR Summary

Medium Risk
Changes how isolated-vm and preview APIs classify and surface sandbox errors (422 vs 500), which can affect client behavior and monitoring/alerting if misclassified.

Overview
Improves sandbox error categorization by introducing IsolatedVMError.isSystemError and using it in runSandboxTask to throw a dedicated SandboxUserCodeError for user-caused failures while treating infrastructure/pool/task failures as system errors.

Document preview endpoints now catch SandboxUserCodeError and return 422 with { error, errorName } (and warn-level logging) instead of always returning 500; tests for PDF/PPTX/DOCX previews were updated to cover the new 422 behavior.

Reviewed by Cursor Bugbot for commit e3e3ea9. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e3e3ea9. Configure here.

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