-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
🔥 Feature: Enhance CheckConstraint method for improved error handling #3356
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
🔥 Feature: Enhance CheckConstraint method for improved error handling #3356
Conversation
WalkthroughThe changes update the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Caller
participant Constraint as Constraint
Caller->>Constraint: CheckConstraint(param)
Constraint->>Constraint: Check for custom constraint override
alt Custom constraint exists
Constraint-->>Caller: return true
else No custom constraint found
Constraint->>Constraint: Validate required data
Constraint->>Constraint: Convert param to int, bool, float, UUID, date
alt Conversion error occurs
Constraint-->>Caller: return false
else All conversions succeed
Constraint-->>Caller: return true
end
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Note 🎁 Summarized by CodeRabbit FreeYour organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
cool interesting |
@JIeJaitt pls check the tests |
…and improve error handling
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3356 +/- ##
==========================================
- Coverage 83.94% 83.93% -0.02%
==========================================
Files 119 119
Lines 11893 11904 +11
==========================================
+ Hits 9984 9992 +8
- Misses 1482 1484 +2
- Partials 427 428 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…benchmark test cases for clarity
…nd clean up CheckConstraint method in path.go
…handling" This reverts commit 68e8777.
… handling" This reverts commit 9e6c8e6.
…us constraint scenarios
…and improve error handling
…benchmark test cases for clarity
…nd clean up CheckConstraint method in path.go
0e02256
to
d92e7f6
Compare
…t/fiber into feature/improve-check-constraint
…constraints in routing guide
…t/fiber into feature/improve-check-constraint
…gofiber#3356) * 🔥 Feature: Enhance CheckConstraint method for improved error handling * Revert "🔥 Feature: Enhance CheckConstraint method for improved error handling" This reverts commit 68e8777. * Reapply "🔥 Feature: Enhance CheckConstraint method for improved error handling" This reverts commit 9e6c8e6. * 🚨 Test: Add comprehensive tests for CheckConstraint method with various constraint scenarios * 🩹 Fix: lint error * 🩹 Fix: Update CheckConstraint method to return true for noConstraint and improve error handling * ♻️ Refactor: Remove unused CheckConstraint test cases and reorganize benchmark test cases for clarity * ♻️ Refactor: Remove outdated test cases from path_testcases_test.go and clean up CheckConstraint method in path.go * 📚 Doc: Update custom constraints section to clarify overriding behavior * 🔥 Feature: Enhance CheckConstraint method for improved error handling * Revert "🔥 Feature: Enhance CheckConstraint method for improved error handling" This reverts commit 68e8777. * Reapply "🔥 Feature: Enhance CheckConstraint method for improved error handling" This reverts commit 9e6c8e6. * 🚨 Test: Add comprehensive tests for CheckConstraint method with various constraint scenarios * 🩹 Fix: lint error * 🩹 Fix: Update CheckConstraint method to return true for noConstraint and improve error handling * ♻️ Refactor: Remove unused CheckConstraint test cases and reorganize benchmark test cases for clarity * ♻️ Refactor: Remove outdated test cases from path_testcases_test.go and clean up CheckConstraint method in path.go * 📚 Doc: Update custom constraints section to clarify overriding behavior * 📚 Doc: Add caution note about custom constraints overriding built-in constraints in routing guide --------- Co-authored-by: Juan Calderon-Perez <[email protected]> Co-authored-by: RW <[email protected]>
Description
Functions can now override custom constraint configurations and gofiber's built-in constraint configurations
close #3352