| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Exceptions\OAuth\Tokens; |
| 4 |
|
| 5 |
use Exception; |
| 6 |
|
| 7 |
/** |
| 8 |
* Class Failed_Storage_Exception |
| 9 |
*/ |
| 10 |
class Failed_Storage_Exception extends Exception { |
| 11 |
|
| 12 |
const DEFAULT_MESSAGE = 'Token storing failed. Please try again.'; |
| 13 |
|
| 14 |
/** |
| 15 |
* Failed_Storage_Exception constructor. |
| 16 |
* |
| 17 |
* @param string $reason The reason why token storage failed. Optional. |
| 18 |
*/ |
| 19 |
public function __construct( $reason = '' ) { |
| 20 |
$message = ( $reason ) ? \sprintf( 'Token storing failed. Reason: %s. Please try again', $reason ) : self::DEFAULT_MESSAGE; |
| 21 |
|
| 22 |
parent::__construct( $message, 500 ); |
| 23 |
} |
| 24 |
} |
| 25 |
|