modified classes for GeneralException thrown

This commit is contained in:
Anton Grebnev
2011-12-06 14:05:18 +04:00
parent 47b5843ef6
commit 71cc211c4f
9 changed files with 51 additions and 26 deletions

View File

@ -22,7 +22,7 @@ class MongoStatement extends DbStatement
$this->result->sort($sort);
return $this;
} else {
throw new Exception('MongoStatement error. Impossible order results of opened cursor.');
throw new GeneralException('MongoStatement error. Impossible order results of opened cursor.');
}
}
@ -32,7 +32,7 @@ class MongoStatement extends DbStatement
$this->result->skip($skip);
return $this;
} else {
throw new Exception('MongoStatement error. Impossible skip results of opened cursor.');
throw new GeneralException('MongoStatement error. Impossible skip results of opened cursor.');
}
}
@ -42,7 +42,7 @@ class MongoStatement extends DbStatement
$this->result->limit($limit);
return $this;
} else {
throw new Exception('MongoStatement error. Impossible limit results of opened cursor.');
throw new GeneralException('MongoStatement error. Impossible limit results of opened cursor.');
}
}
@ -65,7 +65,7 @@ class MongoStatement extends DbStatement
}
break;
default:
throw new Exception('Invalid fetch mode "' . $style . '" specified');
throw new GeneralException('Invalid fetch mode "' . $style . '" specified');
}
return $row;
}
@ -132,7 +132,7 @@ class MongoStatement extends DbStatement
$result = $request->execute();
}
if ($result === false) {
throw new Exception('MongoDB request error.');
throw new GeneralException('MongoDB request error.');
}
if ($result instanceof MongoCursor || is_array($result)) {
$this->result = $result;
@ -148,7 +148,7 @@ class MongoStatement extends DbStatement
}
return true;
} else {
throw new Exception('No connection to MongoDB server.');
throw new GeneralException('No connection to MongoDB server.');
}
}