sparqapi/api/system/core/MY_Exceptions.php
2018-08-23 16:18:19 +05:30

17 lines
521 B
PHP

<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Exceptions extends Exception {
public function __construct($message, $code = 0, Exception $previous = null) {
parent::__construct($message, $code, $previous);
}
// custom string representation of object
public function __toString() {
return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; //edit this to your need
}
}
class MyCustomExtension extends MY_Exceptions {} //define your exceptions