1<?php
2
3namespace dokuwiki\plugin\issuelinks\classes;
4
5/**
6 * Class IssueLinksException
7 *
8 * A translatable exception
9 *
10 * @package dokuwiki\plugin\issuelinks\classes
11 */
12class IssueLinksException extends \RuntimeException
13{
14
15    protected $trans_prefix = 'Exception: ';
16
17    /**
18     * IssueLinksException constructor.
19     *
20     * @param string $message
21     * @param ...string $vars
22     */
23    public function __construct($message)
24    {
25        /** @var \helper_plugin_struct $plugin */
26        $plugin = plugin_load('helper', 'issuelinks_util');
27        $trans = $plugin->getLang($this->trans_prefix . $message);
28        if (!$trans) {
29            $trans = $message;
30        }
31
32        $args = func_get_args();
33        array_shift($args);
34
35        $trans = vsprintf($trans, $args);
36
37        parent::__construct($trans);
38    }
39}
40