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

add ability to customize Variable '<variable name>' has not been defined message #518

Open
wass3rw3rk opened this issue Sep 17, 2024 · 0 comments

Comments

@wass3rw3rk
Copy link
Member

wass3rw3rk commented Sep 17, 2024

when a http action is used that sends a request to populate certain variables, and the request times out, the bot currently returns Variable '<variable name>' has not been defined for any variables that do not get populated. an internal request was filed for the desire to provide a more meaningful message.

desired functionality:

  • change default message (<action_name> action timed out was suggested)
  • per action customization (adding timeout_message field)
  • silently fail if timeout_message is empty string

to note:
"not defined" message does not exclusively happen when requests time out, so perhaps the default message should be something else, or maybe there is a need to define messages for other scenarios, such as when an API returns any non-200 messages.

example rules file:

name: test
active: true
respond: test
actions:
  - name: test rule
    type: GET
    url: http://somehost.example.com/endpoint
    expose_json_fields:
      output: |-
        {{if and (ge ${_raw_http_status} 200) (lt ${_raw_http_status} 300) }}
        {{.message}}
        {{else}}
        request failed with http status code `${_raw_http_status}`
        {{end}}
    timeout: 1
format_output: "${output}" 
direct_message_only: false
help_text: "Sample rules to reproduce Variable `output` has not been defined issue."
include_in_help: true
@wass3rw3rk wass3rw3rk changed the title add ability to customize Variable 'output' has not been defined message add ability to customize Variable '<variable name>' has not been defined message Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant