DCP-2215 refactor: simplify error messages across commands and tests#258
Open
ajmalkhan-eng wants to merge 5 commits intoDCP-2216-prolific-cli-ui-helpers-and-color-supportfrom
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Remove redundant "error: " prefix from error messages throughout the codebase.
This improves consistency and readability of error output.
Changes:
- Remove fmt.Errorf("error: %s", err.Error()) pattern
- Return errors directly where appropriate
- Update corresponding test assertions
78b9ed7 to
11ce80f
Compare
Add support for configuring studies with AI Task Builder data collection: - Add AITaskBuilderDataCollection field to Study model - Add AITaskBuilderPayload to CreateStudyPayload - Render AITB batch ID in study view - Update go.mod dependencies
Add comprehensive instruction examples for AITB: - Add example-instructions.json with multiple question types - Update standard-sample-aitaskbuilder.json with proper formatting - Update batch instructions command help with answer_limit example - Improve dataset upload command description
Add support for creating studies with AITB configuration: - Add --aitb-batch-id flag to study create command - Add --auto-publish flag for automatic study publication - Automatically transition studies to PUBLISHED state when --auto-publish is set - Update tests to cover new AITB and auto-publish functionality
benmatselby
reviewed
Dec 8, 2025
| if !cmd.Flags().Changed("batch-id") { | ||
| expected := aitaskbuilder.ErrBatchIDRequired | ||
| if err.Error() != "error: "+expected { | ||
| if err.Error() != ""+expected { |
Contributor
There was a problem hiding this comment.
question: Do we need the empty string concatenation? Same question in a few test files
Contributor
There was a problem hiding this comment.
Agree. Seems redundant.
Contributor
Author
There was a problem hiding this comment.
Good spot guys.. will yeet.
…core-features DCP-2217 feat: add AI Task Builder core features
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR simplifies error handling across the CLI by removing redundant "error: " prefixes from error messages. This improves consistency and readability of error output throughout the codebase.
Changes
fmt.Errorf("error: %s", err.Error())patternImpact
Testing
All existing tests have been updated and pass with the new error format.
Note
Removes "error:" prefixes across commands/tests, enhances AITB workflow and study models/docs, and improves CLI output styling.
"error: "prefix) across commands; update tests accordingly.client.Instruction.AnswerLimitchanged to*int; examples includeanswer_limit.data_collection_method,data_collection_id, anddata_collection_metadata; render method in study view.external_study_urloptional in create payload.ui.Bold/Dim/Highlightin list views (campaigns, projects, workspaces) and dimmed record counters.ui.WriteSuccess; improveduser whoamistyling.docs/examples/example-instructions.jsonand update AITB study example (standard-sample-aitaskbuilder.json).go.mod(promotetermenv/isattyto direct requirements).Written by Cursor Bugbot for commit 4b1ffb2. This will update automatically on new commits. Configure here.