2020-06-07 11:24:15 +00:00
|
|
|
<?php
|
2022-12-14 16:19:55 +00:00
|
|
|
|
2021-11-18 04:24:30 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020-2021 Антон Аксенов (Anthony Axenov)
|
2020-06-07 11:24:15 +00:00
|
|
|
*
|
|
|
|
* This code is licensed under MIT.
|
|
|
|
* Этот код распространяется по лицензии MIT.
|
|
|
|
* https://github.com/anthonyaxenov/atol-online/blob/master/LICENSE
|
|
|
|
*/
|
|
|
|
|
2022-12-14 16:19:55 +00:00
|
|
|
declare(strict_types=1);
|
2021-11-18 04:24:30 +00:00
|
|
|
|
2020-06-07 11:24:15 +00:00
|
|
|
namespace AtolOnline\Exceptions;
|
|
|
|
|
2021-12-19 14:29:17 +00:00
|
|
|
use AtolOnline\Api\AtolResponse;
|
2020-06-07 11:24:15 +00:00
|
|
|
use Exception;
|
2021-12-12 06:50:29 +00:00
|
|
|
use JetBrains\PhpStorm\Pure;
|
2020-06-07 11:24:15 +00:00
|
|
|
|
|
|
|
/**
|
2021-11-17 16:01:53 +00:00
|
|
|
* Исключение, возникающее при неудачной авторизации
|
2020-06-07 11:24:15 +00:00
|
|
|
*/
|
2021-11-18 04:24:30 +00:00
|
|
|
class AuthFailedException extends Exception
|
2020-06-07 11:24:15 +00:00
|
|
|
{
|
|
|
|
/**
|
2021-11-18 04:24:30 +00:00
|
|
|
* Конструктор
|
2020-06-07 11:24:15 +00:00
|
|
|
*
|
2021-12-19 14:29:17 +00:00
|
|
|
* @param AtolResponse $response
|
2021-11-18 04:24:30 +00:00
|
|
|
* @param string $message
|
2020-06-07 11:24:15 +00:00
|
|
|
*/
|
2021-12-12 06:50:29 +00:00
|
|
|
#[Pure]
|
2021-12-19 14:29:17 +00:00
|
|
|
public function __construct(AtolResponse $response, string $message = '')
|
2020-06-07 11:24:15 +00:00
|
|
|
{
|
2021-11-22 06:51:10 +00:00
|
|
|
parent::__construct(($message ?: 'Ошибка авторизации: ') . ': ' . $response);
|
2020-06-07 11:24:15 +00:00
|
|
|
}
|
2020-10-12 18:06:13 +00:00
|
|
|
}
|