config
9 years ago
css
9 years ago
data
9 years ago
images
9 years ago
js
9 years ago
vendor
9 years ago
views
9 years ago
class-tiny-compress-client.php
9 years ago
class-tiny-compress-fopen.php
9 years ago
class-tiny-compress.php
9 years ago
class-tiny-exception.php
9 years ago
class-tiny-image-size.php
9 years ago
class-tiny-image.php
9 years ago
class-tiny-notices.php
9 years ago
class-tiny-php.php
9 years ago
class-tiny-plugin.php
9 years ago
class-tiny-settings.php
9 years ago
class-tiny-wp-base.php
9 years ago
class-tiny-exception.php
50 lines
| 1 | <?php |
| 2 | /* |
| 3 | * Tiny Compress Images - WordPress plugin. |
| 4 | * Copyright (C) 2015-2017 Voormedia B.V. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the Free |
| 8 | * Software Foundation; either version 2 of the License, or (at your option) |
| 9 | * any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 14 | * more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along |
| 17 | * with this program; if not, write to the Free Software Foundation, Inc., 51 |
| 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | */ |
| 20 | |
| 21 | class Tiny_Exception extends Exception { |
| 22 | protected $type; |
| 23 | protected $status; |
| 24 | |
| 25 | public function __construct( $message, $type = null, $status = null ) { |
| 26 | if ( ! is_string( $message ) || ($type && ! is_string( $type )) ) { |
| 27 | throw new InvalidArgumentException( |
| 28 | 'First two arguments must be strings' |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | $this->type = $type; |
| 33 | $this->status = $status; |
| 34 | |
| 35 | parent::__construct( $message ); |
| 36 | } |
| 37 | |
| 38 | public function get_type() { |
| 39 | return $this->type; |
| 40 | } |
| 41 | |
| 42 | public function get_status() { |
| 43 | return $this->status; |
| 44 | } |
| 45 | |
| 46 | public function get_message() { |
| 47 | return $this->getMessage(); |
| 48 | } |
| 49 | } |
| 50 |