Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (h *WorkflowVersionAddedHandler) validateWorkflowFiles(ctx context.Context,
validateResult, err := exec.Exec(ctx, CommandExecuteTimeout, "java", "-jar", h.womtoolPath, "validate", path.Join(baseDir, mainWorkflowPath), "-l")
if err != nil {
applog.Errorw("fail to validate workflow", "err", err, "result", string(validateResult))
return apperrors.NewInternalError(fmt.Errorf("validate workflow failed"))
return apperrors.NewValidateFailedError(fmt.Errorf("please check if there are any syntax errors in your workflow"))
}
validateResultLines := strings.Split(string(validateResult), "\n")
applog.Infow("validate result", "result", validateResultLines)
Expand Down
1 change: 1 addition & 0 deletions pkg/errors/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
InternalCode
TemporaryDisabledCode
TimeoutCode
ValidateFailedCode
)

// hertz code.
Expand Down
8 changes: 8 additions & 0 deletions pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ func NewInternalError(err error) *AppError {
}
}

func NewValidateFailedError(err error) *AppError {
return &AppError{
Code: ValidateFailedCode,
Message: "validate failed",
Inner: err,
}
}

func NewHertzBindError(err error) *AppError {
return &AppError{
Code: BindErrorCode,
Expand Down