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 FailProcessor extends AbstractProcessor
13{
14    use Traits\IgnoreFailureTrait;
15
16    public function __construct(string $message)
17    {
18        $this->setMessage($message);
19    }
20
21    /**
22     * Set Fail message.
23     *
24     * @return $this
25     */
26    public function setMessage(string $message): self
27    {
28        return $this->setParam('message', $message);
29    }
30}
31