shlink/module/Rest/src/Exception/AuthenticationException.php

18 lines
464 B
PHP
Raw Normal View History

<?php
2017-10-12 11:13:20 +03:00
declare(strict_types=1);
namespace Shlinkio\Shlink\Rest\Exception;
class AuthenticationException extends RuntimeException
{
public static function fromCredentials($username, $password)
{
return new self(sprintf('Invalid credentials. Username -> "%s". Password -> "%s"', $username, $password));
}
2016-08-07 15:44:33 +03:00
public static function expiredJWT(\Exception $prev = null)
{
return new self('The token has expired.', -1, $prev);
}
}