1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6namespace App\Exceptions;
7
8class InvalidScopeException extends SilencedException
9{
10 private $error;
11
12 public function __construct(string $description, string $error = 'invalid_scope')
13 {
14 parent::__construct($description);
15
16 $this->error = $error;
17 }
18
19 /**
20 * The RFC 6749 error code
21 */
22 public function getError(): string
23 {
24 return $this->error;
25 }
26
27 public function getStatusCode()
28 {
29 return 400;
30 }
31}