Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: shared form pw error handling #7991

Merged
merged 3 commits into from Mar 28, 2024
Merged

fix: shared form pw error handling #7991

merged 3 commits into from Mar 28, 2024

Conversation

mertmit
Copy link
Member

@mertmit mertmit commented Mar 28, 2024

Change Summary

  • fix: shared form pw error handling
  • fix: clean-up duplicate file for error handling
  • fix: filter non-generic errors from logs for NcBaseErrorv2

Change type

  • fix: (bug fix for the user, not a fix to a build script)

Summary by CodeRabbit

  • New Features
    • Introduced enhanced error handling capabilities across the platform, including structured error messages for better user experience.
  • Refactor
    • Improved error message handling in form submissions.
    • Updated error handling utilities and middleware for greater efficiency and clarity.
  • Bug Fixes
    • Added handling for a new UNKNOWN_ERROR type to ensure more robust error reporting.

Copy link
Contributor

coderabbitai bot commented Mar 28, 2024

Walkthrough

Walkthrough

The updates focus on enhancing error handling across various components of the system. A new error handling function extractSdkResponseErrorMsgv2 and an NcErrorType enum have been introduced, improving the structure and clarity of error messages. Additionally, a new UNKNOWN_ERROR type has been added to better manage unforeseen errors. These changes are spread across GUI components, utility functions, SDK adjustments, and server-side error filtering, indicating a holistic approach to refining error management throughout the application.

Changes

Files Summary of Changes
.../useSharedFormViewStore.ts
.../errorUtils.ts
Introduced extractSdkResponseErrorMsgv2 and NcErrorType, refining error handling.
.../nocodb-sdk/src/lib/globals.ts Added UNKNOWN_ERROR to NcErrorType enum.
.../global-exception/global-exception.filter.ts Enhanced error handling with NcBaseErrorv2 and specific error checks.
.../helpers/catchError.ts Overhauled error handling, introducing handling for specific error types and added UNKNOWN_ERROR.
.../middlewares/extract-ids/extract-ids.middleware.ts Updated import path for NcError.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit-tests 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 tests 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 7e414ed and 7443e77.
Files selected for processing (6)
  • packages/nc-gui/composables/useSharedFormViewStore.ts (2 hunks)
  • packages/nc-gui/utils/errorUtils.ts (2 hunks)
  • packages/nocodb-sdk/src/lib/globals.ts (1 hunks)
  • packages/nocodb/src/filters/global-exception/global-exception.filter.ts (2 hunks)
  • packages/nocodb/src/helpers/catchError.ts (3 hunks)
  • packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts (1 hunks)
Additional comments (7)
packages/nc-gui/utils/errorUtils.ts (2)
  • 27-58: Consider adding more detailed error logging within the catch block and when returning unknownError to aid in debugging. Additionally, for readability, you might refactor the repeated return unknownError statements by checking conditions upfront and returning early if possible.
  • 60-60: Exporting NcErrorType aligns with the PR's objectives of enhancing error handling across the application.
packages/nocodb-sdk/src/lib/globals.ts (1)
  • 146-146: The addition of UNKNOWN_ERROR to NcErrorType is a good practice, providing a fallback for unclassified errors and enhancing error handling.
packages/nocodb/src/filters/global-exception/global-exception.filter.ts (1)
  • 42-48: Consider enhancing error logging for NcBaseErrorv2 instances to include more details about the error, such as its message and details. This would aid in debugging and align with the PR's objective of improving error handling.
packages/nocodb/src/middlewares/extract-ids/extract-ids.middleware.ts (1)
  • 28-28: Updating the import path for NcError aligns with the PR's objectives of centralizing and enhancing error handling. This change likely improves maintainability and simplifies the codebase.
packages/nc-gui/composables/useSharedFormViewStore.ts (1)
  • 181-190: The use of extractSdkResponseErrorMsgv2 and NcErrorType for error handling in useSharedFormStore enhances error categorization and user feedback. Consider ensuring consistency in error handling across all components for a unified user experience.
packages/nocodb/src/helpers/catchError.ts (1)
  • 427-430: The addition of UNKNOWN_ERROR to the errorHelpers object is a good step towards handling unexpected errors more gracefully. However, it would be beneficial to add documentation explaining when this error type should be used, to ensure clarity and maintainability.

Copy link
Contributor

github-actions bot commented Mar 28, 2024

Uffizzi Preview deployment-49070 was deleted.

@dstala dstala merged commit 0f7b889 into develop Mar 28, 2024
23 checks passed
@dstala dstala deleted the nc-fix/shared-form-pw branch March 28, 2024 11:48
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.

None yet

2 participants