mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
fix: prompt when parameter options are incompatible (#9247)
This commit is contained in:
3
coderd/apidoc/docs.go
generated
3
coderd/apidoc/docs.go
generated
@ -8440,11 +8440,9 @@ const docTemplate = `{
|
||||
"codersdk.JobErrorCode": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"MISSING_TEMPLATE_PARAMETER",
|
||||
"REQUIRED_TEMPLATE_VARIABLES"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"MissingTemplateParameter",
|
||||
"RequiredTemplateVariables"
|
||||
]
|
||||
},
|
||||
@ -8978,7 +8976,6 @@ const docTemplate = `{
|
||||
},
|
||||
"error_code": {
|
||||
"enum": [
|
||||
"MISSING_TEMPLATE_PARAMETER",
|
||||
"REQUIRED_TEMPLATE_VARIABLES"
|
||||
],
|
||||
"allOf": [
|
||||
|
9
coderd/apidoc/swagger.json
generated
9
coderd/apidoc/swagger.json
generated
@ -7572,11 +7572,8 @@
|
||||
},
|
||||
"codersdk.JobErrorCode": {
|
||||
"type": "string",
|
||||
"enum": ["MISSING_TEMPLATE_PARAMETER", "REQUIRED_TEMPLATE_VARIABLES"],
|
||||
"x-enum-varnames": [
|
||||
"MissingTemplateParameter",
|
||||
"RequiredTemplateVariables"
|
||||
]
|
||||
"enum": ["REQUIRED_TEMPLATE_VARIABLES"],
|
||||
"x-enum-varnames": ["RequiredTemplateVariables"]
|
||||
},
|
||||
"codersdk.License": {
|
||||
"type": "object",
|
||||
@ -8070,7 +8067,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"error_code": {
|
||||
"enum": ["MISSING_TEMPLATE_PARAMETER", "REQUIRED_TEMPLATE_VARIABLES"],
|
||||
"enum": ["REQUIRED_TEMPLATE_VARIABLES"],
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/codersdk.JobErrorCode"
|
||||
|
@ -525,7 +525,7 @@ func (b *Builder) getParameters() (names, values []string, err error) {
|
||||
// At this point, we've queried all the data we need from the database,
|
||||
// so the only errors are problems with the request (missing data, failed
|
||||
// validation, immutable parameters, etc.)
|
||||
return nil, nil, BuildError{http.StatusBadRequest, err.Error(), err}
|
||||
return nil, nil, BuildError{http.StatusBadRequest, fmt.Sprintf("Unable to validate parameter %q", templateVersionParameter.Name), err}
|
||||
}
|
||||
names = append(names, templateVersionParameter.Name)
|
||||
values = append(values, value)
|
||||
|
Reference in New Issue
Block a user