Skip to content

Commit ef9c1c4

Browse files
committed
Don't wrap input errors in buildplanner errors
1 parent 26129e4 commit ef9c1c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/platform/model/buildplanner/build.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ func processBuildPlannerError(bpErr error, fallbackMessage string) error {
123123
return &response.BuildPlannerError{Err: locale.NewExternalError("err_buildplanner_deprecated", "Encountered deprecation error: {{.V0}}", graphqlErr.Message)}
124124
}
125125
}
126+
if locale.IsInputError(bpErr) {
127+
// If this is an input error then we shouldn't wrap it in a vague buildplanner error that's "unexpected",
128+
// because evidently we expected it or we wouldn't mark it an input error.
129+
// https://activestatef.atlassian.net/browse/DX-2957
130+
return bpErr
131+
}
126132
return &response.BuildPlannerError{Err: locale.NewExternalError("err_buildplanner", "{{.V0}}: Encountered unexpected error: {{.V1}}", fallbackMessage, bpErr.Error())}
127133
}
128134

0 commit comments

Comments
 (0)