xref: /plugin/oauth/Exception.php (revision d18263316993ca656dd50ef0c7612088e075a215)
174b4d4a4SAndreas Gohr<?php
274b4d4a4SAndreas Gohr
374b4d4a4SAndreas Gohrnamespace dokuwiki\plugin\oauth;
474b4d4a4SAndreas Gohr
574b4d4a4SAndreas Gohr/**
6e170f465SAndreas Gohr * Our own OAuth Plugin Exceptions
774b4d4a4SAndreas Gohr *
874b4d4a4SAndreas Gohr * @todo maybe add debug logging here later
9e170f465SAndreas Gohr * @todo add translations here
1074b4d4a4SAndreas Gohr */
11e170f465SAndreas Gohrclass Exception extends \OAuth\Common\Exception\Exception
1274b4d4a4SAndreas Gohr{
13*d1826331SAndreas Gohr    protected $context = [];
14*d1826331SAndreas Gohr
15*d1826331SAndreas Gohr    /**
16*d1826331SAndreas Gohr     * @param string $message
17*d1826331SAndreas Gohr     * @param array $context
18*d1826331SAndreas Gohr     * @param int $code
19*d1826331SAndreas Gohr     * @param \Throwable|null $previous
20*d1826331SAndreas Gohr     */
21*d1826331SAndreas Gohr    public function __construct($message = "", $context = [], $code = 0, \Throwable $previous = null)
22*d1826331SAndreas Gohr    {
23*d1826331SAndreas Gohr        parent::__construct($message, $code, $previous);
24*d1826331SAndreas Gohr        $this->context = $context;
25*d1826331SAndreas Gohr    }
26*d1826331SAndreas Gohr
27*d1826331SAndreas Gohr    /**
28*d1826331SAndreas Gohr     * Get the translation context
29*d1826331SAndreas Gohr     *
30*d1826331SAndreas Gohr     * @return array
31*d1826331SAndreas Gohr     */
32*d1826331SAndreas Gohr    public function getContext()
33*d1826331SAndreas Gohr    {
34*d1826331SAndreas Gohr        return $this->context;
35*d1826331SAndreas Gohr    }
36*d1826331SAndreas Gohr
37*d1826331SAndreas Gohr    /**
38*d1826331SAndreas Gohr     * Set the translation context
39*d1826331SAndreas Gohr     *
40*d1826331SAndreas Gohr     * @param array $context
41*d1826331SAndreas Gohr     */
42*d1826331SAndreas Gohr    public function setContext(array $context)
43*d1826331SAndreas Gohr    {
44*d1826331SAndreas Gohr        $this->context = $context;
45*d1826331SAndreas Gohr    }
46*d1826331SAndreas Gohr
4774b4d4a4SAndreas Gohr}
48