/** * * * @return MNumberOutOfRangeException */ public function __construct(MNumber $number, MNumber $lowerBound, MNumber $upperBound, MException $previous = null) { parent::__construct(Sf("Number [%s] out of range [%s-%s]", $number->toString()->stringValue(), $lowerBound->toString()->stringValue(), $upperBound->toString()->stringValue()), MException::NUMBER_OUT_OF_RANGE_EXCEPTION_CODE, $previous); $this->number = $number; $this->lowerBound = $lowerBound; $this->upperBound = $upperBound; }
/** * Creates a new instance of MManagedObjectException * * @param MManagedObject $object The Managed Object that cause the exception to be raised * @param MString|null $object The description of the error * @param MException|null $previous The previous exception that caused this exception to * be raised * * @return MManagedObjectException The new exception instance */ public function __construct(MManagedObject $object, MString $description = null, MException $previous = null) { if ($description == null) { $description = S("Unknown Managed Object Error"); } $description = Sf("%s [%s]", $description, $object); parent::__construct($description, MException::MANAGED_OBJECT_EXCEPTION_CODE, $previous); }
/** * * * @return MIndexOutOfBoundsException */ public function __construct($index = 0, $lowerBound = 0, $upperBound = 0, MException $previous = null) { MAssertTypes('int', $index, 'int', $lowerBound, 'int', $upperBound); parent::__construct(Sf("Index [%d] out of bounds [%d -> %d]", $index, $lowerBound, $upperBound), MException::NUMBER_OUT_OF_RANGE_EXCEPTION_CODE, $previous); $this->index = $index; $this->lowerBound = $lowerBound; $this->upperBound = $upperBound; }
/** * Creates a new model parse error exception instance * * @param MFile $modelFile The file that caused the parse error * @param MString|null $description The description of the error * @param MException|null $previous The previous exception that cause this error to * happen * * @return MModelParseErrorException The new exception instance */ public function __construct(MFile $modelFile, MString $description = null, MException $previous = null) { $d = $description; if ($d == null) { $d = Sf("Model Parse Error on file [%s]", $modelFile->path()->stringValue()); } else { $d = $d->stringByAppendingString(Sf("\nModel file: [%s]", $modelFile->path()->stringValue())); } parent::__construct($d, MException::MODEL_PARSE_ERROR_EXCEPTION_CODE, $previous); $this->modelFile = $modelFile; }
/** * * * @return MInputOutputException */ public function __construct(MException $previous = null) { parent::__construct(S("Input/Output Exception"), MException::INPUT_OUTPUT_EXCEPTION, $previous); }
public function __construct(MString $fieldName, MException $previous = null) { parent::__construct(Sf("Field named '%s' undefined", $fieldName), MException::FIELD_UNDEFINED_EXCEPTION, $previous); $this->fieldName = $fieldName; }
/** * 构造函数 * @param string $message 错误消息 * @param integer $code 错误代码 */ public function __construct($message, $code = 0) { parent::__construct($message, $code); }
/** * * * @return MBadRequestException */ public function __construct(MString $description = null, MException $previous = null) { parent::__construct($description, MException::BAD_REQUEST_EXCEPTION_CODE, $previous); }
/** * * * @return MNaNException */ public function __construct($value, MException $parent = null) { parent::__construct(Sf("Value (%s) is not a number!", $value), MException::NAN_EXCEPTION_CODE, $parent); }
/** * Initializes a new instance of MEntityNotFoundException * * This exception is thrown when the specified entity is not found * * @param MString $entityName The name of the entity that could not be found * @param MException $previous A previous exception which caused this exception * to be raised */ public function __construct(MString $entityName, MException $previous = null) { parent::__construct(Sf("The entity named '%s' could not be found", $entityName), MException::ENTITY_NOT_FOUND_EXCEPTION_CODE, $previous); }
/** * * * @return MMethodNotSupportedException */ public function __construct(MString $method = null, MException $previous = null) { parent::__construct(Sf("Method not supported ['%s']", $method), MException::METHOD_NOT_SUPPORTED_EXCEPTION_CODE, $previous); }
/** * * * @return MStreamException */ public function __construct(MStream $stream, MString $description = null, $code = MException::STREAM_EXCEPTION_CODE, MException $previous = null) { parent::__construct($description, $code, $previous); $this->stream = $stream; }
/** * * * @return MInvalidDataTypeException */ public function __construct(MString $expected, MString $given, MException $previous = null) { parent::__construct(Sf("Invalid data type exception. Expecting %s but %s was given!", $expected, $given), MException::INVALID_DATA_TYPE_EXCEPTION_CODE, $previous); $this->expected = $expected; $this->given = $given; }
/** * * @return MInvalidOperationException */ public function __construct(MString $description = null, MException $previous = null) { parent::__construct($description, MException::INVALID_OPERATION_EXCEPTION_CODE, $previous); }
/** * Creates a new Persistent Store Exception instance * * @param MString|null $description The description of the exception * @param MException|null $previous The previous exception that caused this * exception to be raised * * @return MPersistentStoreException The new exception instance */ public function __construct(MString $description = null, MException $previous = null) { parent::__construct($description, MException::PERSITENT_STORE_EXCEPTION_CODE, $previous); }
public function __construct(MString $parameterName, MException $previous = null) { parent::__construct(Sf("Parameter named '%s' undefined", $parameterName), MException::PARAMETER_UNDEFINED_EXCEPTION, $previous); $this->parameterName = $parameterName; }
public function __construct($msg = null, $code = 0, $goTo = '') { parent::__construct($msg, $code); $this->goTo = $goTo; }
public function __construct(MString $filePath, MException $previous = null) { parent::__construct(Sf("File at path '%s' could not be found!", $filePath), MException::FILE_NOT_FOUND_EXCEPTION, $previous); $this->filePath = $filePath; }
public function __construct(MString $fileName, MNumber $line = null, MString $description = null, MException $previous = null) { parent::__construct($description, MException::PARSE_ERROR_EXCEPTION_CODE, $previous); $this->fileName = $fileName; $this->line = $line; }