From aa4f1b5f5d49380ed9394facd62b6854ff1aabd9 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sat, 30 Aug 2014 16:47:22 +0200 Subject: [PATCH] Removing dependency on the Network namespace in the ORM Instead, make the RecordNotFound exception send the correct error number --- src/ORM/Error/RecordNotFoundException.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ORM/Error/RecordNotFoundException.php b/src/ORM/Error/RecordNotFoundException.php index ccc330a4316..7ef1fbaa604 100644 --- a/src/ORM/Error/RecordNotFoundException.php +++ b/src/ORM/Error/RecordNotFoundException.php @@ -14,12 +14,23 @@ */ namespace Cake\ORM\Error; -use Cake\Network\Exception\NotFoundException; +use RuntimeException; /** * Exception raised when a particular record was not found * */ -class RecordNotFoundException extends NotFoundException { +class RecordNotFoundException extends RuntimeException { + +/** + * Constructor. + * + * @param string $message The error message + * @param int $code The code of the error, is also the HTTP status code for the error. + * @param \Exception $previous the previous exception. + */ + public function __construct($message, $code = 404, $previous = null) { + parent::__construct($message, $code, $previous); + } }