Skip to content

Better error handling for notifier = in message step #826

Closed
@e-gineer

Description

Accidentally passing a string to notifier = causes an unhelpful error message and doing the same thing via a param is an outright crash.

Here is a sample mod to reproduce:

mod "local" {
  title = "flowpipe-mod-issues"
}

pipeline "notifier_reference_errors" {

  param "notifier" {
    type = string
    default = "default"
  }

  step "message" "simple_notifier_works" {
    notifier = notifier.default
    text = "test message"
  }

  step "message" "notifier_name_bug_unhelpful_error" {
    # accidentially give notifier name instead of actual notifier
    # Error: value is not a collection
    notifier = "default"
    text = "test message"
  }

  step "message" "notifier_param_crashes" {
    # accidentially give notifier name via param
    # [flowpipe] Execution ID: exec_co6pb1so47mlvo0cjbjg
    # {"time":"2024-04-03T13:44:39.109068-04:00","level":"ERROR","msg":"Recovered from panic","error":null}
    # [notifier_reference_errors] Starting pipeline
    notifier = param.notifier
    text = "test message"
  }

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions