Skip to content
Permalink
Browse files

Fix $previous becoming null only

Also fixed $code becoming 500 when null given.
  • Loading branch information...
chinpei215 committed Oct 7, 2017
1 parent 42f8054 commit bf374572d7cafa3c8a3170601224c40bc13e3bec
Showing with 3 additions and 9 deletions.
  1. +2 −9 src/Datasource/Exception/PageOutOfBoundsException.php
  2. +1 −0 tests/TestCase/ExceptionsTest.php
@@ -25,14 +25,7 @@ class PageOutOfBoundsException extends Exception
protected $_messageTemplate = 'Page number %s could not be found.';
/**
* Constructor
*
* @param array|null $message Paging info.
* @param int $code The code of the error, is also the HTTP status code for the error.
* @param \Exception|null $previous The previous exception.
* {@inheritDoc}
*/
public function __construct($message = null, $code = 404, $previous = null)
{
parent::__construct($message, $code, $previous = null);
}
protected $_defaultCode = 404;
}
@@ -145,6 +145,7 @@ public function exceptionProvider()
['Cake\Datasource\Exception\MissingDatasourceConfigException', 500],
['Cake\Datasource\Exception\MissingDatasourceException', 500],
['Cake\Datasource\Exception\MissingModelException', 500],
['Cake\Datasource\Exception\PageOutOfBoundsException', 404],
['Cake\Datasource\Exception\RecordNotFoundException', 404],
['Cake\Mailer\Exception\MissingActionException', 404],
['Cake\Mailer\Exception\MissingMailerException', 500],

0 comments on commit bf37457

Please sign in to comment.
You can’t perform that action at this time.