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