1<?php
2
3namespace Elastica\Processor;
4
5/**
6 * Elastica Fail Processor.
7 *
8 * @author Federico Panini <fpanini@gmail.com>
9 *
10 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/fail-processor.html
11 */
12class Fail extends AbstractProcessor
13{
14    /**
15     * Fail constructor.
16     *
17     * @param string $message
18     */
19    public function __construct(string $message)
20    {
21        $this->setMessage($message);
22    }
23
24    /**
25     * Set Fail message.
26     *
27     * @param string $message
28     *
29     * @return $this
30     */
31    public function setMessage(string $message): self
32    {
33        return $this->setParam('message', $message);
34    }
35}
36