2018-12-20 21:04:54 +08:00
|
|
|
[[fail-processor]]
|
2020-08-12 23:28:00 +08:00
|
|
|
=== Fail processor
|
|
|
|
++++
|
|
|
|
<titleabbrev>Fail</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
2018-12-20 21:04:54 +08:00
|
|
|
Raises an exception. This is useful for when
|
|
|
|
you expect a pipeline to fail and want to relay a specific message
|
|
|
|
to the requester.
|
|
|
|
|
|
|
|
[[fail-options]]
|
|
|
|
.Fail Options
|
|
|
|
[options="header"]
|
|
|
|
|======
|
|
|
|
| Name | Required | Default | Description
|
2021-03-16 00:22:57 +08:00
|
|
|
| `message` | yes | - | The error message thrown by the processor. Supports <<template-snippets,template snippets>>.
|
2018-12-20 21:04:54 +08:00
|
|
|
include::common-options.asciidoc[]
|
|
|
|
|======
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"fail": {
|
|
|
|
"if" : "ctx.tags.contains('production') != true",
|
2021-04-07 03:33:10 +08:00
|
|
|
"message": "The production tag is not present, found tags: {{{tags}}}"
|
2018-12-20 21:04:54 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// NOTCONSOLE
|