Will try catch with branch #1336
Unanswered
smalljimmy
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Yep! But don't trust me and try it out yourself. input:
generate:
mapping: |
root = {}
interval: 0s
count: 1
pipeline:
processors:
- try:
- branch:
request_map: |
root = this
processors:
- bloblang: |
throw("kaboom!")
result_map: |
root.verified = this
- log:
message: "The rest of the processors in `try` won't get executed"
- catch:
- bloblang: |
root.meta.error = error()
root.status = 400
- log:
message: "The catch processor clears the error: ${! error() }"
output:
stdout:
codec: lines |
Beta Was this translation helpful? Give feedback.
2 replies
-
Thank you. In my case, the test_processor is a HTTP processor
And I notice the catch blocker is NOT executed if the http call failed with 500 error. Is there a way to capture such error using try..catch? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Suppose I have following pipeline definition.
Will catch block be executed when test_processor fails?
Beta Was this translation helpful? Give feedback.
All reactions