mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: propagate job error codes (#6507)
* feat: propagate job error_code * fix * Fix * Fix * Fix * add errors to typesGenerated * Address PR comments * Fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@@ -196,7 +197,8 @@ func createValidTemplateVersion(cmd *cobra.Command, args createValidTemplateVers
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
if !provisionerd.IsMissingParameterError(err.Error()) {
|
||||
var jobErr *cliui.ProvisionerJobError
|
||||
if errors.As(err, &jobErr) && !provisionerd.IsMissingParameterErrorCode(string(jobErr.Code)) {
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
@@ -233,7 +235,7 @@ func createValidTemplateVersion(cmd *cobra.Command, args createValidTemplateVers
|
||||
}
|
||||
}
|
||||
|
||||
if provisionerd.IsMissingParameterError(version.Job.Error) {
|
||||
if provisionerd.IsMissingParameterErrorCode(string(version.Job.ErrorCode)) {
|
||||
valuesBySchemaID := map[string]codersdk.ComputedParameter{}
|
||||
for _, parameterValue := range parameterValues {
|
||||
valuesBySchemaID[parameterValue.SchemaID.String()] = parameterValue
|
||||
|
||||
Reference in New Issue
Block a user