Change reader exceptions to PHPExcel_Reader_Exception

This commit is contained in:
Mark Baker
2012-10-29 23:48:29 +00:00
parent d66f61bfbb
commit 8f3640e44c
18 changed files with 167 additions and 123 deletions
+11 -11
View File
@@ -174,7 +174,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
*
* @param string $pFileName
* @return boolean
* @throws Exception
* @throws PHPExcel_Reader_Exception
*/
public function canRead($pFilename)
{
@@ -196,7 +196,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
// Read sample data (first 2 KB will do)
@@ -227,16 +227,16 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
* Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
*
* @param string $pFilename
* @throws Exception
* @throws PHPExcel_Reader_Exception
*/
public function listWorksheetNames($pFilename)
{
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
if (!$this->canRead($pFilename)) {
throw new Exception($pFilename . " is an Invalid Spreadsheet file.");
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
}
$worksheetNames = array();
@@ -258,13 +258,13 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
*
* @param string $pFilename
* @throws Exception
* @throws PHPExcel_Reader_Exception
*/
public function listWorksheetInfo($pFilename)
{
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
$worksheetInfo = array();
@@ -330,7 +330,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
*
* @param string $pFilename
* @return PHPExcel
* @throws Exception
* @throws PHPExcel_Reader_Exception
*/
public function load($pFilename)
{
@@ -392,7 +392,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
* @param string $pFilename
* @param PHPExcel $objPHPExcel
* @return PHPExcel
* @throws Exception
* @throws PHPExcel_Reader_Exception
*/
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
{
@@ -427,11 +427,11 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
// Check if file exists
if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
}
if (!$this->canRead($pFilename)) {
throw new Exception($pFilename . " is an Invalid Spreadsheet file.");
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
}
$xml = simplexml_load_file($pFilename);