Skip to content

Conversation

@EagleoutIce
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds functionality to track and query exceptions thrown by functions in R code. The implementation includes both the core exception tracking logic and a new query API to inspect which functions may throw exceptions.

  • Adds a new inspect-exception query to identify functions that throw exceptions
  • Improves tryCatch handling to properly track exception control flow and error handler behavior
  • Refactors common query filtering logic into a shared utility function

Reviewed changes

Copilot reviewed 15 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/dataflow/fn/exceptions-of-function.ts New module implementing exception tracking by traversing the call graph to find error exit points
src/dataflow/internal/process/functions/call/built-in/built-in-try-catch.ts Enhanced tryCatch processing to track error handlers, control dependencies, and call graph edges
src/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.ts New query format definition with schema, parser, and result formatting for exception inspection
src/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.ts Query executor and shared helper function for filtering functions in the call graph
src/queries/query.ts Registers the new inspect-exception query type
src/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.ts Refactored to use shared getFunctionsToConsiderInCallGraph helper
src/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.ts Refactored to use shared getFunctionsToConsiderInCallGraph helper
src/documentation/wiki-query.ts Documents the new exception inspection query with examples
src/documentation/doc-util/doc-query.ts Adds comment clarifying wiki generation validation
test/functionality/dataflow/functions/exceptions-functions.test.ts Comprehensive tests for exception tracking through function calls and try-catch blocks
test/functionality/dataflow/processing-of-elements/exceptions/dataflow-exceptions.test.ts Updates tests for improved tryCatch exception handling behavior
test/functionality/dataflow/call-graph/call-graph.test.ts Adds test for finally clause handling in tryCatch call graph
wiki/Core.md Auto-generated documentation updates (timestamps and performance metrics)
wiki/Capabilities.md Auto-generated capability status updates for S3/S4 OOP support
README.md Auto-generated examples with updated performance timings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@EagleoutIce EagleoutIce merged commit a9dff9f into main Jan 3, 2026
19 checks passed
@EagleoutIce EagleoutIce deleted the 2104-query-to-find-out-what-errors-a-function-may-throw branch January 3, 2026 09:55
@EagleoutIce
Copy link
Member Author

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.

Query(?) to find out what errors a function may throw

2 participants