Skip to content

Commit

Permalink
Merge pull request #112 from zf1s/zend-exception-allow-throwable-as-p…
Browse files Browse the repository at this point in the history
…revious

[zend-exception] allow Throwable in $previous
  • Loading branch information
falkenhawk authored Oct 1, 2021
2 parents e769567 + ca1560f commit abfdc0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/zend-db/library/Zend/Db/Statement/Pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public function fetch($style = null, $cursor = null, $offset = null)
return $this->_stmt->fetch($style, $cursor, $offset);
} catch (ValueError $e) {
// PHP 8.0+ throws ValueError on invalid arguments
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode());
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
Expand Down Expand Up @@ -295,7 +295,7 @@ public function fetchAll($style = null, $col = null)
}
} catch (ValueError $e) {
// PHP 8.0+ throws ValueError on invalid arguments
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode());
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
Expand Down Expand Up @@ -439,7 +439,7 @@ public function setFetchMode($mode)
return $this->_stmt->setFetchMode($mode);
} catch (ValueError $e) {
// PHP 8.0+ throws ValueError on invalid arguments
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode());
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
Expand Down
4 changes: 2 additions & 2 deletions packages/zend-exception/library/Zend/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class Zend_Exception extends Exception
*
* @param string $msg
* @param int $code
* @param Exception $previous
* @param Exception|Throwable $previous
* @return void
*/
public function __construct($msg = '', $code = 0, Exception $previous = null)
public function __construct($msg = '', $code = 0, $previous = null)
{
parent::__construct($msg, (int) $code, $previous);
}
Expand Down

0 comments on commit abfdc0d

Please sign in to comment.