-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix #3907: allow custom error message on invalid_date issue code #4064
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request adds new test cases for the Changes
Sequence Diagram(s)sequenceDiagram
participant T as Test Case
participant Z as z.date() Parser
participant E as Error Handler
T->>Z: Call z.date() with invalid date & custom error message
Z-->>T: Throw error { code: "invalid_date", message: custom message }
T->>T: Catch and assert error properties
sequenceDiagram
participant C as Caller
participant P as processCreateParams
participant D as Default Error (ctx.defaultError)
C->>P: Provide RawCreateParams with issue code
P->>P: Check if iss.code is "invalid_type" or "invalid_date"
alt Code is "invalid_type" or "invalid_date"
P-->>C: Process using custom logic
else
P->>D: Retrieve default error message
D-->>P: Return default error message
P-->>C: Return processed result
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🔇 Additional comments (4)
✨ Finishing Touches
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. 🪧 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 (
|
✅ Deploy Preview for guileless-rolypoly-866f8a ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Deployment failed with the following error:
|
Overview
This PR adds support for custom error messages when the issue code is
"invalid_date"
.Why is this change non-breaking?
"invalid_date"
validation now allows custom error messages."Invalid date"
message is still used.Example Usage
The following code now correctly applies a custom error message:
Summary by CodeRabbit
Tests
Bug Fixes