public function __construct($object, $interface_name, $prev = NULL)
 {
     $class_name = $object instanceof Charcoal_Object ? $object->getClassName() : get_class($object);
     $object_hash = $object instanceof Charcoal_Object ? $object->hash() : spl_object_hash($object);
     $object_str = '[' . $class_name . '] id=' . $object_hash;
     parent::__construct("Object[{$object_str}] must implement interface[{$interface_name}]", $prev);
 }
 public function __construct($arg, $prev = NULL)
 {
     $expr = '';
     switch (gettype($arg)) {
         case 'string':
         case 'integer':
         case 'float':
         case 'boolean':
             $expr = "{$arg}";
             break;
         case 'NULL':
             $expr = 'NULL';
             break;
         case 'unknown type':
             $expr = 'unknown type';
             break;
         case 'array':
             $expr = print_r($arg, true);
             break;
         case 'object':
             $expr = method_exists($arg, '_toString') ? "{$arg}" : gettype($arg) . '#' . spl_object_hash($arg);
             break;
     }
     parent::__construct("Invalid argument: {$expr}", $prev);
 }
 public function __construct($message, $prev = NULL)
 {
     if ($prev) {
         parent::__construct($message, $prev);
     } else {
         parent::__construct($message);
     }
 }
 public function __construct($class_name, $field_name, $annotaion_name, $message, $prev = NULL)
 {
     $msg = "[class name] {$class_name} [field name] {$field_name} [annotaion name] {$annotaion_name}";
     if ($message) {
         $msg .= " [message] {$message}";
     }
     parent::__construct($msg, $prev);
 }
 public function __construct(Charcoal_String $messsage, Exception $previous = NULL)
 {
     if ($previous) {
         parent::__construct(s($messsage), $previous);
     } else {
         parent::__construct(s($messsage));
     }
 }
 public function __construct($argument, $option_name, $prev = NULL)
 {
     Charcoal_ParamTrait::validateString(1, $argument);
     Charcoal_ParamTrait::validateString(2, $option_name);
     Charcoal_ParamTrait::validateException(3, $prev, TRUE);
     $this->argument = $argument;
     $this->option_name = $option_name;
     parent::__construct("Invalid argument for -{$option_name}: {$argument}", $prev);
 }
 public function __construct(Qdmail $qdmail, Exception $previous = NULL)
 {
     $this->stack = $qdmail->errorStatment();
     $msg = "Qdmail error:" . print_r($this->stack, true);
     if ($previous) {
         parent::__construct(s($msg), $previous);
     } else {
         parent::__construct(s($msg));
     }
     foreach ($this->stack as $item) {
         log_error("mail", $item);
     }
 }
 public function __construct(Qdsmtp $qdsmtp, Exception $previous = NULL)
 {
     $this->stack = $qdsmtp->errorStatment();
     foreach ($this->stack as $item) {
         if (strpos($item, "Error :status555") !== FALSE) {
             $this->status_code = Charcoal_EnumSmtpStatusCode::SYNTAX_ERROR;
             // 555
             break;
         } elseif (strpos($item, "Error :status503") !== FALSE) {
             $this->status_code = Charcoal_EnumSmtpStatusCode::BAD_SEQUENCE_OF_COMMANDS;
             // 503
             break;
         }
     }
     $msg = $this->toString();
     if ($previous) {
         parent::__construct(s($msg), $previous);
     } else {
         parent::__construct(s($msg));
     }
 }
 public function __construct($stack, $prev = NULL)
 {
     parent::__construct("stack is empty: {$stack}", $prev);
 }
 public function __construct($driver_type, $message, $prev = NULL)
 {
     parent::__construct("driver_type=[{$driver_type}] message=[{$message}]", $prev);
 }
 public function __construct($path, $prev = NULL)
 {
     parent::__construct("File upload failed(UPLOAD_ERR_CANT_WRITE): {$path}", $prev);
 }
 public function __construct($obj_path, $message = NULL, $prev = NULL)
 {
     $this->obj_path = $obj_path;
     parent::__construct("Bad object pathformat({$message}): {$obj_path}", $prev);
 }
 public function __construct($url, $prev = NULL)
 {
     parent::__construct("[{$url}] is not suitable for URI", $prev);
 }
 public function __construct($operation, $prev = NULL)
 {
     parent::__construct("not supported operation: {$operation}", $prev);
 }
 public function __construct($run_mode, $prev = NULL)
 {
     parent::__construct("Illegal run mode: [{$run_mode}]", $prev);
 }
 public function __construct(Charcoal_String $expression, $prev = NULL)
 {
     parent::__construct("Illegal query target format: {$expression}", $prev);
 }
 public function __construct($message, $prev = NULL)
 {
     parent::__construct($message, $prev);
 }
 public function __construct($operation, $reason = NULL, $prev = NULL)
 {
     parent::__construct("file system operation failed: [operation]{$operation} [reason]{$reason}", $prev);
 }
 public function __construct($path, $needed = NULL, $prev = NULL)
 {
     $perm = file_exists($path) ? substr(sprintf('%o', fileperms($path)), -4) : '---';
     parent::__construct("file permission is not enough: {$path} perm=[{$perm}] needed=[{$needed}]", $prev);
 }
 public function __construct($unit, $prev = NULL)
 {
     parent::__construct("[{$unit}] is not supported", $prev);
 }
 public function __construct($interface_name, $prev = NULL)
 {
     //        Charcoal_ParamTrait::validateString( 1, $interface_name );
     parent::__construct("Interface not found: interface_name=[{$interface_name}]", $prev);
 }
 public function __construct($value, $prev = NULL)
 {
     parent::__construct("can't convert to object: {$value}", $prev);
 }
 public function __construct($value, $prev = NULL)
 {
     $value = Charcoal_System::toString($value);
     parent::__construct("can't convert to string object: {$value}", $prev);
 }
 public function __construct($layout_manager, $prev = NULL)
 {
     parent::__construct("Failed to create layout manager: [{$layout_manager}]", $prev);
 }
 public function __construct($model, $field, $message, $prev = NULL)
 {
     parent::__construct("a field of table model seems to be wrong: [model]{$model} [field]{$field} [message]{$message}", $prev);
 }
 public function __construct($section, $prev = NULL)
 {
     parent::__construct("section({$section}) is not found", $prev);
 }
 public function __construct($test_data, $prev = NULL)
 {
     parent::__construct("Test data not found: [{$test_data}]", $prev);
 }
 public function __construct(Charcoal_Class $klass, Charcoal_Vector $args, $prev = NULL)
 {
     $class_name = $klass->getClassName();
     parent::__construct("[class_name]{$class_name} [args]{$args}", $prev);
 }
 public function __construct($config_file, $profile_name, $prev = NULL)
 {
     //        Charcoal_ParamTrait::validateString( 1, $config_file );
     //        Charcoal_ParamTrait::validateString( 2, $profile_name );
     parent::__construct("Profile loading failed. [config_file]{$config_file} [profile_name]{$profile_name}", $prev);
 }
 public function __construct($encoding, $prev = NULL)
 {
     parent::__construct("Invalid encoding type: {$encoding}", $prev);
 }