Exemplo n.º 1
0
 /**
  * @param string $name
  * @param string|null $message
  */
 function __construct($name, $message = null)
 {
     if (empty($message)) {
         $message = "Param '{$name}' is required";
     }
     parent::__construct($message);
 }
 /**
 * Construct the InvalidControllerActionError
 *
 * @access public
 * @param string $controller Controller name
 * @param string $action Controller action
 * @param string $message Error message, if NULL default will be used
 * @return InvalidControllerActionError
 */
 function __construct($controller, $action, $message = null) {
   if(is_null($message)) $message = "Invalid controller action $controller::$action()";
   parent::__construct($message);
   
   $this->setController($controller);
   $this->setAction($action);
 } // __construct
 /**
 * Construct the FailedToMoveFileError
 *
 * @access public
 * @param string $from_path
 * @param string $to_path
 * @param string $message If NULL default message will be used
 * @return FailedToMoveFileError
 */
 function __construct($from_path, $to_path, $message = null) {
   if(is_null($message)) $message = "Failed to move file '$from_path' to '$to_path'";
   parent::__construct($message);
   
   $this->setFromPath($from_path);
   $this->setToPath($to_path);
 } // __construct
Exemplo n.º 4
0
 /**
  * @param string $name
  * @param string $expected_location
  * @param string|null $message
  */
 function __construct($name, $expected_location, $message = null)
 {
     if (empty($message)) {
         $message = "Theme '{$name}' was not found at '{$expected_location}'";
     }
     parent::__construct($message);
 }
 /**
  * Construct the OwnerCompanyDnxError
  *
  * @param string $message
  * @return OwnerCompanyDnxError
  */
 function __construct($message = null)
 {
     if (is_null($message)) {
         $message = 'Owner company is not defined';
     }
     parent::__construct($message);
 }
 /**
  * Constructor
  *
  * @param void
  * @return UploadError
  */
 function __construct($code)
 {
     switch ($code) {
         case UPLOAD_ERR_INI_SIZE:
             $message = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';
             break;
         case UPLOAD_ERR_FORM_SIZE:
             $message = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';
             break;
         case UPLOAD_ERR_PARTIAL:
             $message = 'The uploaded file was only partially uploaded';
             break;
         case UPLOAD_ERR_NO_FILE:
             $message = 'No file was uploaded';
             break;
         case UPLOAD_ERR_NO_TMP_DIR:
             $message = 'Missing a temporary folder';
             break;
         case UPLOAD_ERR_CANT_WRITE:
             $message = 'Failed to write file to disk';
             break;
         case UPLOAD_ERR_EXTENSION:
             $message = 'File upload stopped by extension';
             break;
         default:
             $message = 'Unknown file upload error';
     }
     // switch
     parent::__construct($message);
 }
Exemplo n.º 7
0
 /**
  * @param string $expected_location
  * @param string|null $message
  */
 function __construct($expected_location, $message = null)
 {
     if (empty($message)) {
         $message = "Temp folder not found at '{$expected_location}'";
     }
     parent::__construct($message);
 }
 /**
  * @param string $expected_location
  * @param string|null $message
  */
 function __construct($expected_location, $message = null)
 {
     if (empty($message)) {
         $message = "File '{$expected_location}' was not found";
     }
     parent::__construct($message);
 }
Exemplo n.º 9
0
 /**
  * @param \Exception $exception
  */
 public function __construct(\Exception $exception)
 {
     parent::__construct($exception);
     $this->fileName = $exception->getFile();
     $this->line = $exception->getLine();
     $this->trace = $exception->getTraceAsString();
 }
 /**
 * Constructor
 *
 * @param array $errors Array of errors
 * @param string $message If NULL default message will be used
 * @return FormSubmissionErrors
 */
 function __construct($errors, $message = null) {
   if(is_null($message)) {
     $message = 'Form submission failed';
   } // if
   parent::__construct($message);
   $this->setErrors($errors);
 } // __construct
Exemplo n.º 11
0
 /**
  * Construct exception instance
  *
  * @param string $json
  * @param int $json_error
  * @param string|null $message
  */
 function __construct($json, $json_error, $message = null)
 {
     $this->json = $json;
     $this->json_error = $json_error;
     if (empty($message)) {
         switch ($json_error) {
             case JSON_ERROR_DEPTH:
                 $message = 'The maximum stack depth has been exceeded';
                 break;
             case JSON_ERROR_STATE_MISMATCH:
                 $message = 'Invalid or malformed JSON';
                 break;
             case JSON_ERROR_CTRL_CHAR:
                 $message = 'Control character error, possibly incorrectly encoded';
                 break;
             case JSON_ERROR_SYNTAX:
                 $message = 'Syntax error';
                 break;
             case JSON_ERROR_UTF8:
                 $message = 'Malformed UTF-8 characters, possibly incorrectly encoded';
                 break;
             default:
                 if (defined('JSON_ERROR_RECURSION') && $json_error === JSON_ERROR_RECURSION) {
                     $message = 'One or more recursive references in the value to be encoded';
                 } elseif (defined('JSON_ERROR_INF_OR_NAN') && $json_error === JSON_ERROR_INF_OR_NAN) {
                     $message = 'One or more NAN or INF values in the value to be encoded';
                 } elseif (defined('JSON_ERROR_UNSUPPORTED_TYPE') && $json_error === JSON_ERROR_UNSUPPORTED_TYPE) {
                     $message = 'A value of a type that cannot be encoded was given';
                 } else {
                     $message = 'Failed to parse JSON';
                 }
         }
     }
     parent::__construct($message);
 }
Exemplo n.º 12
0
 /**
  * Construct the FileDnxError.
  *
  * @param string $file_path
  * @param string $message
  */
 public function __construct($file_path, $message = null)
 {
     if (is_null($message)) {
         $message = "File '{$file_path}' doesn't exists";
     }
     parent::__construct($message, ['path' => $file_path]);
 }
 /**
  * Construct the AdministratorDnxError
  *
  * @param string $message
  * @return AdministratorDnxError
  */
 function __construct($message = null)
 {
     if (is_null($message)) {
         $message = 'Administrator account is not defined';
     }
     parent::__construct($message);
 }
Exemplo n.º 14
0
 /**
  * Construct the DirDnxError
  *
  * @access public
  * @param string $dir_path
  * @param string $message
  * @return DirDnxError
  */
 function __construct($dir_path, $message = null)
 {
     if (is_null($message)) {
         $message = "Directory '{$dir_path}' doesn't exists";
     }
     parent::__construct($message);
     $this->setDirPath($dir_path);
 }
 /**
  * Construct the ImageTypeNotSupportedError
  *
  * @access public
  * @param void
  * @return ImageTypeNotSupportedError
  */
 function __construct($file_path, $type_value, $message = null)
 {
     if (is_null($message)) {
         $message = "This type of image is not supported. SimpleGD supports only PNG, JPG and GIF image types. Type: {$type_value}";
     }
     parent::__construct($message);
     $this->setFilePath($file_path);
 }
 /**
  * Construct the FileRepositoryDeleteError
  *
  * @access public
  * @param void
  * @return FileRepositoryDeleteError
  */
 function __construct($file_id, $message = null)
 {
     if (is_null($message)) {
         $message = "Failed to remove '{$file_id}' from the '{$repository_path}' repository";
     }
     parent::__construct($message);
     $this->setFileId($file_id);
 }
 /**
  * Construct the InvalidEmailAddress
  *
  * @access public
  * @param void
  * @return InvalidEmailAddress
  */
 function __construct($email, $message = null)
 {
     if (is_null($message)) {
         $message = "Email address '{$email}' is not valid";
     }
     parent::__construct($message);
     $this->setEmail($email);
 }
 /**
  * Construct the FailedToCreateFolderError
  *
  * @access public
  * @param string $folder_path
  * @param string $message If NULL default message will be used
  * @return FailedToCreateFolderError
  */
 function __construct($folder_path, $message = null)
 {
     if (is_null($message)) {
         $message = "Failed to create folder '{$folder_path}'";
     }
     parent::__construct($message);
     $this->setFolderPath($folder_path);
 }
 /**
  * Construct the LibraryDnxError
  *
  * @access public
  * @param string $library Library name
  * @param string $message Error message. If NULL default message will be used
  * @return LibraryDnxError
  */
 function __construct($library, $message = null)
 {
     if (is_null($message)) {
         $message = "Library '{$library}' does not exists";
     }
     parent::__construct($message);
     $this->setLibrary($library);
 }
 /**
  * Constructor
  *
  * @param string $message
  * @return NoPermissionsError
  */
 function __construct($message = null)
 {
     if ($message === null) {
         $message = 'You don\'t have permissions to access this page / execute this action';
     }
     // if
     parent::__construct($message, false);
 }
 /**
  * Construct the FailedToLoadImageError
  *
  * @param string $file_path
  * @param string $message If NULL default message will be used
  * @return FileNotImageError
  */
 function __construct($file_path, $message = null)
 {
     if (is_null($message)) {
         $message = "Failed to load image from '{$file_path}'";
     }
     parent::__construct($message);
     $this->setFilePath($file_path);
 }
Exemplo n.º 22
0
 public function __construct($message = null)
 {
     $msg = 'Произошла ошибка сервера.';
     if ($message !== null) {
         $msg .= ' - ' . $message . '.';
     }
     parent::__construct($msg);
 }
 /**
  * Construct the FileNotWriableError
  *
  * @access public
  * @param void
  * @return FileNotWriableError
  */
 function __construct($file_path, $message = null)
 {
     if (is_null($message)) {
         $message = "File '{$file_path}' is not writable";
     }
     parent::__construct($message);
     $this->setFilePath($file_path);
 }
Exemplo n.º 24
0
 /**
  * Construct the FileDnxError
  *
  * @access public
  * @param void
  * @return FileDnxError
  */
 function __construct($file_path, $message = null)
 {
     if (is_null($message)) {
         $message = "File '{$file_path}' doesn't exists";
     }
     parent::__construct($message);
     $this->setFilePath($file_path);
 }
 /**
  * Construct the FailedToWriteFileError
  *
  * @access public
  * @param void
  * @return FailedToWriteFileError
  */
 function __construct($file_path, $message = null)
 {
     if (is_null($message)) {
         $message = "Failed to write content into '{$file_path}'";
     }
     parent::__construct($message);
     $this->setFilePath($file_path);
 }
 /**
  * Construct the FileNotInRepositoryError
  *
  * @access public
  * @param void
  * @return FileNotInRepositoryError
  */
 function __construct($file_id, $message = null)
 {
     if (is_null($message)) {
         $message = "File '{$file_id}' can not be found in the repository";
     }
     parent::__construct($message);
     $this->setFileId($file_id);
 }
 /**
  * Construct the DirNotWritable
  *
  * @access public
  * @param string $dir_path
  * @param string $message
  * @return DirNotWritable
  */
 function __construct($dir_path, $message = null)
 {
     if (is_null($message)) {
         $message = "Directory '{$dir_path}' is not writable by PHP";
     }
     parent::__construct($message);
     $this->setDirPath($dir_path);
 }
 /**
  * Construct the FileRepositoryAddError
  *
  * @access public
  * @param string $source Soruce file
  * @param string $repository_dir
  * @param string $unique_file_id
  * @param string $message Exception message
  * @return FileRepositoryAddError
  */
 function __construct($source, $unique_file_id = null, $message = null)
 {
     if (is_null($message)) {
         $message = "Failed to import file '{$source}' to the file repository (unique file id: {$unique_file_id})";
     }
     parent::__construct($message);
     $this->setSource($source);
     $this->setUniqueFileId($unique_file_id);
 }
 /**
  * Constructor
  *
  * @param string $request_string
  * @param string $message
  * @return Angie_Router_Error_Match
  */
 function __construct($request_string, $message = null)
 {
     if (is_null($message)) {
         $message = "String '{$request_string}' does not match any of mapped routes";
     }
     // if
     $this->setRequestString($request_string);
     parent::__construct($message);
 }
 public function __construct($reason = null, $fieldPath = null, $trigger = null, $errorString = null, $ApiErrorType = null)
 {
     parent::__construct();
     $this->reason = $reason;
     $this->fieldPath = $fieldPath;
     $this->trigger = $trigger;
     $this->errorString = $errorString;
     $this->ApiErrorType = $ApiErrorType;
 }