Browse Source

Removing dependency on the Network namespace in the ORM

Instead, make the RecordNotFound exception send the correct error number
Jose Lorenzo Rodriguez 11 years ago
parent
commit
aa4f1b5f5d
1 changed files with 13 additions and 2 deletions
  1. 13 2
      src/ORM/Error/RecordNotFoundException.php

+ 13 - 2
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);
+	}
 
 }