Skip to content
Permalink
Browse files

Enhanced Exceptions.

  • Loading branch information...
parkerj committed Jun 18, 2018
1 parent 9c0b931 commit 8a81ed3852bd149e768958f49232605e7125c8f7
Showing with 18 additions and 9 deletions.
  1. +6 −3 Liten/Exception/BaseException.php
  2. +7 −4 Liten/Exception/LitenException.php
  3. +5 −2 Liten/Exception/ViewException.php
@@ -3,8 +3,8 @@
/**
* Liten - PHP 5 micro framework
*
* @link https://www.litenframework.com
* @since 1.0.1
* @link http://www.litenframework.com
* @version 1.0.1
* @package Liten
*
* The MIT License (MIT)
@@ -28,6 +28,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
if (!defined('BASE_PATH'))
exit('No direct script access allowed');
interface BaseException
{
/* Protected methods inherited from Exception class */
@@ -48,5 +51,5 @@ public function getTraceAsString(); // Formated string of trace
public function __toString(); // formated string for display
public function __construct($message = null, $code = 0);
public function __construct($message = null, $code = 0, $previous = null);
}
@@ -3,8 +3,8 @@
/**
* Liten - PHP 5 micro framework
*
* @link https://www.litenframework.com
* @since 1.0.1
* @link http://www.litenframework.com
* @version 1.0.1
* @package Liten
*
* The MIT License (MIT)
@@ -28,6 +28,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
if (!defined('BASE_PATH'))
exit('No direct script access allowed');
abstract class LitenException extends \Exception implements BaseException
{
@@ -38,12 +41,12 @@ abstract class LitenException extends \Exception implements BaseException
protected $line; // Source line of exception
private $trace; // Unknown
public function __construct($message = null, $code = 0)
public function __construct($message = null, $code = 0, $previous = null)
{
if (!$message) {
throw new $this('Unknown ' . get_class($this));
}
parent::__construct($message, $code);
parent::__construct($message, $code, $previous);
}
public function __toString()
@@ -3,8 +3,8 @@
/**
* Liten - PHP 5 micro framework
*
* @link https://www.litenframework.com
* @since 1.0.0
* @link http://www.litenframework.com
* @version 1.0.0
* @package Liten
*
* The MIT License (MIT)
@@ -28,6 +28,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
if (!defined('BASE_PATH'))
exit('No direct script access allowed');
class ViewException extends LitenException
{

0 comments on commit 8a81ed3

Please sign in to comment.
You can’t perform that action at this time.