-
Notifications
You must be signed in to change notification settings - Fork 141
docs: Custom error messages in the input schema #2121
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: master
Are you sure you want to change the base?
Conversation
|
Preview for this PR was built for commit |
|
Preview for this PR was built for commit |
valekjo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
marcel-rbro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well written and structured. I like that the beginning of the page is very readable. I am not sure about the last section though.
sources/platform/actors/development/actor_definition/input_schema/custom_error_messages.md
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/input_schema/custom_error_messages.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/input_schema/custom_error_messages.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/input_schema/custom_error_messages.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/input_schema/custom_error_messages.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/input_schema/custom_error_messages.md
Outdated
Show resolved
Hide resolved
sources/platform/actors/development/actor_definition/input_schema/custom_error_messages.md
Outdated
Show resolved
Hide resolved
| ## Best practices | ||
|
|
||
| While custom error messages can improve the user experience by providing clearer guidance, it's generally better to rely on the default error messages unless there's a specific need for customization. Only use custom error messages when they significantly help users understand the requirements better than the default messages. | ||
|
|
||
| If you do decide to use custom error messages, follow these best practices: | ||
|
|
||
| 1. **Be specific** - Clearly explain what is required or what went wrong | ||
| 2. **Be concise** - Keep messages short and to the point | ||
| 3. **Be helpful** - Provide guidance on how to fix the issue | ||
| 4. **Be consistent** - Use a similar tone and style across all messages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this entire section. Do we want to be the source of information about how to write error messages? @TC-MO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question tbh. It feels like this is better suited for Academy then our Platform docs, let me think a bit on that. Apart from that:
- Bold is for UI elements. (at least for now), so it should be either italics, or no emphasis whatsoever.
- Ordered lists should be done with all 1. since Docusaurus can handle then the numbering while rendering the page and maintenance is much easier
Document custom error messages in the input schema, introduced by apify/apify-shared-js#567 (based on the specification here)
Note
Documents custom validation error messages for input schema and links them from the spec and index.
input_schema/custom_error_messages.mdexplainingerrorMessageusage, supported validation keywords, nesting, and best practices.input_schema/specification.mdto includeerrorMessagein input field properties table with link to the new page.input_schema/index.mdto reference the spec, secrets, and new custom error messages guide.Written by Cursor Bugbot for commit 19d0412. Configure here.