Skip to content

Python: Handle RPC deserialization errors in PythonRewriteRpc#parseProject()#6812

Merged
knutwannheden merged 1 commit intomainfrom
this-stack-trace-indicates
Feb 25, 2026
Merged

Python: Handle RPC deserialization errors in PythonRewriteRpc#parseProject()#6812
knutwannheden merged 1 commit intomainfrom
this-stack-trace-indicates

Conversation

@knutwannheden
Copy link
Copy Markdown
Contributor

@knutwannheden knutwannheden commented Feb 25, 2026

Summary

  • Catch exceptions from getObject() in PythonRewriteRpc.parseProject()'s Spliterator and emit a ParseError instead of aborting the entire parse stream
  • Add sourcePath to ParseProjectResponse.Item (both Python and Java sides) so the ParseError identifies which file failed
  • Matches the existing error-handling pattern in RewriteRpc.parse()

Context

When an RPC deserialization error occurs (e.g., UnsupportedOperationException: Unknown state type END_OF_OBJECT), the exception propagated uncaught from tryAdvance() and killed the entire project parse operation. With this fix, the failing source file is represented as a ParseError and parsing continues with the remaining files.

@knutwannheden knutwannheden force-pushed the this-stack-trace-indicates branch from 8eb6e89 to 902fd5f Compare February 25, 2026 08:47
@knutwannheden knutwannheden merged commit e7f8710 into main Feb 25, 2026
1 check passed
@knutwannheden knutwannheden deleted the this-stack-trace-indicates branch February 25, 2026 09:04
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Feb 25, 2026
@knutwannheden knutwannheden changed the title Handle RPC deserialization errors in PythonRewriteRpc#parseProject() Python: Handle RPC deserialization errors in PythonRewriteRpc#parseProject() Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant