Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Finally. Atk-wide way for chained exceptions

  • Loading branch information...
commit 06106d577e5c262c610a3d5d0b876af755462b2f 1 parent 846de81
Romans Malinovskis romaninsh authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/AbstractObject.php
12 lib/AbstractObject.php
View
@@ -21,6 +21,8 @@
*/
public $elements = array ();
+ public $default_exception='BaseException';
+
/////////////// I n i t i a l i z e o b j e c t /////////////
function init() {
/**
@@ -222,6 +224,16 @@ function removeElement($short_name){
}
/////////////// M e s s a g e h a n d l i n g //////////////
+ function exception($message,$type=null){
+ if(!$type){
+ $type=$this->default_exception;
+ }else{
+ $type='Exception_'.$type;
+ }
+
+ $e=new $type($message);
+ return $e;
+ }
function fatal($error, $shift = 0) {
/**
* If you have fatal error in your object use the following code:
Please sign in to comment.
Something went wrong with that request. Please try again.