1<?php 2 3namespace dokuwiki\plugin\oauth; 4 5/** 6 * Our own OAuth Plugin Exceptions 7 * 8 * @todo maybe add debug logging here later 9 * @todo add translations here 10 */ 11class Exception extends \OAuth\Common\Exception\Exception 12{ 13 protected $context = []; 14 15 /** 16 * @param string $message 17 * @param array $context 18 * @param int $code 19 * @param \Throwable|null $previous 20 */ 21 public function __construct($message = "", $context = [], $code = 0, \Throwable $previous = null) 22 { 23 parent::__construct($message, $code, $previous); 24 $this->context = $context; 25 } 26 27 /** 28 * Get the translation context 29 * 30 * @return array 31 */ 32 public function getContext() 33 { 34 return $this->context; 35 } 36 37 /** 38 * Set the translation context 39 * 40 * @param array $context 41 */ 42 public function setContext(array $context) 43 { 44 $this->context = $context; 45 } 46} 47