Browse Source

Fixing more errors related to namespace changes

Jose Lorenzo Rodriguez 11 years ago
parent
commit
18ed6de193
3 changed files with 9 additions and 9 deletions
  1. 5 5
      src/Network/Response.php
  2. 3 3
      src/Network/Socket.php
  3. 1 1
      src/ORM/Error/RecordNotFoundException.php

+ 5 - 5
src/Network/Response.php

@@ -15,7 +15,7 @@
 namespace Cake\Network;
 
 use Cake\Core\Configure;
-use Cake\Error;
+use Cake\Network\Exception\NotFoundException;
 use Cake\Utility\File;
 use InvalidArgumentException;
 use RuntimeException;
@@ -1332,7 +1332,7 @@ class Response {
  *   to a file, `APP` will be prepended to the path.
  * @param array $options Options See above.
  * @return void
- * @throws \Cake\Error\NotFoundException
+ * @throws \Cake\Network\Exception\NotFoundException
  */
 	public function file($path, array $options = array()) {
 		$options += array(
@@ -1341,7 +1341,7 @@ class Response {
 		);
 
 		if (strpos($path, '..') !== false) {
-			throw new Error\NotFoundException('The requested file contains `..` and will not be read.');
+			throw new NotFoundException('The requested file contains `..` and will not be read.');
 		}
 
 		if (!is_file($path)) {
@@ -1351,9 +1351,9 @@ class Response {
 		$file = new File($path);
 		if (!$file->exists() || !$file->readable()) {
 			if (Configure::read('debug')) {
-				throw new Error\NotFoundException(sprintf('The requested file %s was not found or not readable', $path));
+				throw new NotFoundException(sprintf('The requested file %s was not found or not readable', $path));
 			}
-			throw new Error\NotFoundException(__d('cake', 'The requested file was not found'));
+			throw new NotFoundException(__d('cake', 'The requested file was not found'));
 		}
 
 		$extension = strtolower($file->ext());

+ 3 - 3
src/Network/Socket.php

@@ -354,7 +354,7 @@ class Socket {
  * @param bool $enable enable or disable encryption. Default is true (enable)
  * @return bool True on success
  * @throws \InvalidArgumentException When an invalid encryption scheme is chosen.
- * @throws \Cake\Network\Error\SocketException When attempting to enable SSL/TLS fails
+ * @throws \Cake\Network\Exception\SocketException When attempting to enable SSL/TLS fails
  * @see stream_socket_enable_crypto
  */
 	public function enableCrypto($type, $clientOrServer = 'client', $enable = true) {
@@ -366,7 +366,7 @@ class Socket {
 			$enableCryptoResult = stream_socket_enable_crypto($this->connection, $enable, $this->_encryptMethods[$type . '_' . $clientOrServer]);
 		} catch (\Exception $e) {
 			$this->setLastError(null, $e->getMessage());
-			throw new Error\SocketException($e->getMessage());
+			throw new SocketException($e->getMessage());
 		}
 		if ($enableCryptoResult === true) {
 			$this->encrypted = $enable;
@@ -374,7 +374,7 @@ class Socket {
 		}
 		$errorMessage = 'Unable to perform enableCrypto operation on the current socket';
 		$this->setLastError(null, $errorMessage);
-		throw new Error\SocketException($errorMessage);
+		throw new SocketException($errorMessage);
 	}
 
 }

+ 1 - 1
src/ORM/Error/RecordNotFoundException.php

@@ -14,7 +14,7 @@
  */
 namespace Cake\ORM\Error;
 
-use Cake\Error\NotFoundException;
+use Cake\Network\Exception\NotFoundException;
 
 /**
  * Exception raised when a particular record was not found