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

internal/testrunner/runners/pipeline: clarify warning of error.message type #1286

Merged
merged 1 commit into from
Jun 1, 2023
Merged
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
10 changes: 10 additions & 0 deletions internal/testrunner/runners/pipeline/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,16 @@ func checkErrorMessage(event json.RawMessage) error {
return nil
case string, []string:
return fmt.Errorf("unexpected pipeline error: %s", m)
case []interface{}:
for i, v := range m {
switch v.(type) {
case string:
break
default:
return fmt.Errorf("unexpected pipeline error (unexpected error.message type %T at position %d): %v", v, i, m)
}
}
return fmt.Errorf("unexpected pipeline error: %s", m)
default:
return fmt.Errorf("unexpected pipeline error (unexpected error.message type %T): %[1]v", m)
}
Expand Down