Skip to content

chore: log evaluation error logs and push execption to sentry#40170

Merged
dvj1988 merged 1 commit intoreleasefrom
add-eval-error-logs
Apr 8, 2025
Merged

chore: log evaluation error logs and push execption to sentry#40170
dvj1988 merged 1 commit intoreleasefrom
add-eval-error-logs

Conversation

@dvj1988
Copy link

@dvj1988 dvj1988 commented Apr 8, 2025

Description

This PR makes sure that any error in evaluation is not supressed by the code and when it happens it does the following

  • Shows a generic evaluation error to the user as a toast message
  • Log the error in the main thread console
  • Send an exception to Sentry

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.Sanity"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14338015962
Commit: 9ed590d
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Tue, 08 Apr 2025 16:34:49 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced error logging and reporting to ensure evaluation issues are consistently captured and tracked.
  • Chores

    • Expanded error diagnostics by including additional context for improved troubleshooting.

@dvj1988 dvj1988 marked this pull request as ready for review April 8, 2025 12:48
@dvj1988 dvj1988 requested a review from ApekshaBhosale as a code owner April 8, 2025 12:48
@dvj1988 dvj1988 self-assigned this Apr 8, 2025
@dvj1988 dvj1988 added the ok-to-test Required label for CI label Apr 8, 2025
@dvj1988 dvj1988 requested a review from vsvamsi1 April 8, 2025 12:48
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Apr 8, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 8, 2025

Walkthrough

The changes enhance error handling across the codebase. The saga-based evalErrorHandler now logs all errors at a higher severity, using log.error() and reporting them to Sentry. Additionally, the error interface in DynamicBindingUtils has been extended to optionally include a stack trace. In the evaluation handler, the conditional check for CrashingError was removed in favor of a standardized error object that includes both message and stack details.

Changes

Files Change Summary
app/.../EvalErrorHandler.ts
app/.../evalTree.ts
Updated error handling: switched from log.debug to log.error and added Sentry exception capture in various error cases. In evalTree.ts, removed the CrashingError check to standardize error reporting with message and stack details.
app/.../DynamicBindingUtils.ts Extended the EvalError interface by adding an optional stack?: string property to support stack trace debugging.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant EvalErrorHandler
    participant Logger
    participant Sentry
    Caller->>EvalErrorHandler: Emit error (e.g., EVAL_TREE_ERROR)
    EvalErrorHandler->>Logger: log.error(error)
    EvalErrorHandler->>Sentry: captureException(error)
Loading
sequenceDiagram
    participant EvalTree
    participant Logger
    EvalTree->>EvalTree: Execute evaluation logic
    EvalTree->>EvalTree: Catch error
    EvalTree->>Logger: log.error(error)
    EvalTree->>EvalTree: Append error object with type EVAL_TREE_ERROR and stack
Loading

Poem

In code where errors once hid in the shade,
Now log.error and Sentry lend the aid.
A stack trace whispers secrets anew,
As eval flows embrace the clear and true.
Debug dreams take wing—a symphony in code! 🚀


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5824b81 and 9ed590d.

📒 Files selected for processing (3)
  • app/client/src/sagas/EvalErrorHandler.ts (3 hunks)
  • app/client/src/utils/DynamicBindingUtils.ts (1 hunks)
  • app/client/src/workers/Evaluation/handlers/evalTree.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-build / client-build
🔇 Additional comments (10)
app/client/src/utils/DynamicBindingUtils.ts (1)

171-171: Good addition of stack trace support.

This addition allows error objects to include stack traces, which is crucial for effective debugging.

app/client/src/workers/Evaluation/handlers/evalTree.ts (2)

13-13: Excellent import cleanup.

The CrashingError import has been removed in favor of a more standardized error handling approach.


272-276: Improved error handling with stack trace.

The error handling has been standardized to consistently capture both the error message and stack trace. This is more robust than the previous implementation that had conditional checks for CrashingError.

app/client/src/sagas/EvalErrorHandler.ts (7)

258-259: Upgraded logging severity for cyclical dependency errors.

Changed from debug to error level logging to ensure these critical issues are properly captured.


266-267: Enhanced error visibility for evaluation tree errors.

Added error-level logging and Sentry reporting for better error tracking and troubleshooting.


271-272: Improved tracking for bad uneval tree errors.

Added proper error logging and Sentry capture for this error type, which was previously missing.


276-277: Enhanced visibility for property evaluation errors.

Upgraded to error-level logging and added Sentry capture to better track these issues.


281-287: Restored and enhanced error reporting for clone errors.

Re-implemented Sentry reporting with additional context information, which improves debugging capabilities.


296-297: Better error visibility for JS parsing errors.

Added error-level logging and Sentry capture for JavaScript parsing issues.


307-308: Enhanced default error handling.

Upgraded to error-level logging and added Sentry capture for any unhandled error types.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dvj1988 dvj1988 enabled auto-merge (squash) April 8, 2025 13:00
@dvj1988 dvj1988 requested a review from rajatagrawal April 8, 2025 13:00
@dvj1988 dvj1988 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 8, 2025
@dvj1988 dvj1988 merged commit 410e4ea into release Apr 8, 2025
70 of 126 checks passed
@dvj1988 dvj1988 deleted the add-eval-error-logs branch April 8, 2025 16:34
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Apr 12, 2025
…thorg#40170)

## Description
This PR makes sure that any error in evaluation is not supressed by the
code and when it happens it does the following
- Shows a generic evaluation error to the user as a toast message
- Log the error in the main thread console
- Send an exception to Sentry

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Enhanced error logging and reporting to ensure evaluation issues are
consistently captured and tracked.
  
- **Chores**
- Expanded error diagnostics by including additional context for
improved troubleshooting.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai bot mentioned this pull request Apr 25, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants