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

Emphasize named things in error messages. #2939

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/locale/locales/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ field_localized_field:
err_could_not_marshal_print:
other: "Could not marshal the value being printed, please check the error log for more information."
err_no_structured_output:
other: "This command does not support the {{.V0}} output format. Please try again without that output flag."
other: "This command does not support the '{{.V0}}' output format. Please try again without that output flag."
err_main_outputer:
other: "Could not create output writer, please contact developers if this problem persists. Error: {{.V0}}"
field_name:
Expand Down Expand Up @@ -1101,9 +1101,9 @@ err_fetch_project:
err_set_default_branch:
other: Could not update project field with branch, please manually set the `branch={{.V0}}` query parameter on the project field in your activestate.yaml.
artifact_download_failed:
other: Failed to download artifact {{.V0}} ({{.V1}})
other: Failed to download artifact '{{.V0}}' ({{.V1}})
artifact_setup_failed:
other: Failed to install artifact {{.V0}} ({{.V1}})
other: Failed to install artifact '{{.V0}}' ({{.V1}})
err_stored_artifacts:
other: Could not unmarshal stored artifacts, your install may be corrupted.
err_fetch_branch:
Expand Down
4 changes: 2 additions & 2 deletions internal/runners/initialize/rationalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func rationalizeError(namespace *project.Namespaced, rerr *error) {
case bpModel.AlreadyExistsErrorType:
*rerr = errs.WrapUserFacing(
pcErr,
locale.Tl("err_create_project_exists", "The project {{.V0}} already exists under {{.V1}}", namespace.Project, namespace.Owner),
locale.Tl("err_create_project_exists", "The project '{{.V0}}' already exists under '{{.V1}}'", namespace.Project, namespace.Owner),
errs.SetInput(),
)
case bpModel.ForbiddenErrorType:
Expand All @@ -63,7 +63,7 @@ func rationalizeError(namespace *project.Namespaced, rerr *error) {
case bpModel.NotFoundErrorType:
*rerr = errs.WrapUserFacing(
pcErr,
locale.Tl("err_create_project_not_found", "Could not create project because the organization {{.V0}} was not found.", namespace.Owner),
locale.Tl("err_create_project_not_found", "Could not create project because the organization '{{.V0}}' was not found.", namespace.Owner),
errs.SetInput(),
errs.SetTips(locale.T("err_init_authenticated")))
}
Expand Down
2 changes: 1 addition & 1 deletion internal/runners/scripts/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func verifyPathEditor(editor string) (string, error) {

_, err := os.Stat(editor)
if err != nil {
return "", locale.WrapInputError(err, "error_edit_stat_editor", "Failed to find editor {{.V0}} on file system.", editor)
return "", locale.WrapInputError(err, "error_edit_stat_editor", "Failed to find editor '{{.V0}}' on file system.", editor)
}

return editor, nil
Expand Down
2 changes: 1 addition & 1 deletion internal/runners/swtch/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func resolveIdentifier(project *mono_models.Project, idParam string) (identifier

branch, err := model.BranchForProjectByName(project, idParam)
if err != nil {
return nil, locale.WrapError(err, "err_identifier_branch", "Could not get branch {{.V0}} for current project", idParam)
return nil, locale.WrapError(err, "err_identifier_branch", "Could not get branch '{{.V0}}' for current project", idParam)

}

Expand Down
2 changes: 1 addition & 1 deletion internal/scriptrun/scriptrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (s *ScriptRun) Run(script *project.Script, args []string) error {
err = locale.WrapInputError(
err,
"err_run_script",
"Script execution fell back to {{.V0}} after {{.V1}} was not detected in your project or system. Please ensure your script is compatible with one, or more, of: {{.V0}}, {{.V1}}",
"Script execution fell back to '{{.V0}}' after '{{.V1}}' was not detected in your project or system. Please ensure your script is compatible with one, or more, of: {{.V0}}, {{.V1}}",
lang.String(),
strings.Join(attempted, ", "),
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/runtime/buildplan/buildplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func buildTerminals(nodeID strfmt.UUID, lookup map[strfmt.UUID]interface{}, resu
}

if !model.IsSuccessArtifactStatus(targetArtifact.Status) {
return locale.NewError("err_artifact_failed", "Artifact {{.V0}} failed to build", trimDisplayName(targetArtifact.DisplayName))
return locale.NewError("err_artifact_failed", "Artifact '{{.V0}}' failed to build", trimDisplayName(targetArtifact.DisplayName))
}

if model.IsStateToolArtifact(targetArtifact.MimeType) {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/init_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (suite *InitIntegrationTestSuite) TestInit_AlreadyExists() {
ts.LoginAsPersistentUser()

cp := ts.Spawn("init", fmt.Sprintf("%s/test-project", e2e.PersistentUsername), "--language", "python@3")
cp.Expect("The project test-project already exists under cli-integration-tests")
cp.Expect("The project 'test-project' already exists under 'cli-integration-tests'")
cp.ExpectExitCode(1)
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/shell_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (suite *ShellIntegrationTestSuite) TestJSON() {
defer ts.Close()

cp := ts.Spawn("shell", "--output", "json")
cp.Expect(`"error":"This command does not support the json output format`)
cp.Expect(`"error":"This command does not support the 'json' output format`)
cp.ExpectExitCode(0)
AssertValidJSON(suite.T(), cp)
}
Expand Down
Loading