Author: rick
Date: 2010-03-17 22:09:27 +0100 (Wed, 17 Mar 2010)
New Revision: 28594
Modified:
plugins/sfCouchPlugin/trunk/lib/sfCouchConnection.class.php
plugins/sfCouchPlugin/trunk/lib/sfCouchResponse.class.php
Log:
Modified: plugins/sfCouchPlugin/trunk/lib/sfCouchConnection.class.php
===================================================================
--- plugins/sfCouchPlugin/trunk/lib/sfCouchConnection.class.php 2010-03-17
20:37:09 UTC (rev 28593)
+++ plugins/sfCouchPlugin/trunk/lib/sfCouchConnection.class.php 2010-03-17
21:09:27 UTC (rev 28594)
@@ -93,7 +93,7 @@
break;
default:
- throw new sFException( $option );
+ throw new exception('sfCouch: ' . $options);
}
}
@@ -142,7 +142,7 @@
$method = strtoupper( $method );
if ( !isset( self::$allowedMethods[$method] ) )
{
- throw new sfException('Unsupported request method: ' . $method);
+ throw new exception('sfCouch: Unsupported request method: ' .
$method);
}
// Check if required parameter containing the path is set and valid.
@@ -176,7 +176,7 @@
( ( $this->connection = fsockopen( $this->options['ip'],
$this->options['port'], $errno, $errstr ) ) === false ) )
{
// This is a bit hackisch...
- throw new sfException("Could not connect to couchdb server");
+ throw new exception("sfCouch: Could not connect to couchdb
server");
}
}
@@ -231,7 +231,7 @@
* @param bool $raw
* @return sfCouchResponse
*/
- protected function request( $method, $path, $data)
+ protected function request($method, $path, $data)
{
// Try establishing the connection to the server
$this->checkConnection();
@@ -269,7 +269,7 @@
// leave handling to the user for now.
if ( $line === false )
{
- throw new sfException( 'Connection abborted unexpectedly
(nonexisting Database?)');
+ throw new exception('sfCouch: Connection abborted unexpectedly
(nonexisting Database?)');
}
do {
@@ -349,7 +349,7 @@
fwrite( $fp, "\n" . $rawHeaders . "\n" . $body . "\n" );
fclose( $fp );
}
-
+
// Handle some response state as special cases
switch ( $headers['status'] )
{
Modified: plugins/sfCouchPlugin/trunk/lib/sfCouchResponse.class.php
===================================================================
--- plugins/sfCouchPlugin/trunk/lib/sfCouchResponse.class.php 2010-03-17
20:37:09 UTC (rev 28593)
+++ plugins/sfCouchPlugin/trunk/lib/sfCouchResponse.class.php 2010-03-17
21:09:27 UTC (rev 28594)
@@ -59,7 +59,7 @@
// Check if such an property exists at all
if ( !isset( $this->properties[$property] ) )
{
- throw new sfException( $property );
+ throw new exception('sfCouch: ' . $property );
}
return $this->properties[$property];
@@ -111,7 +111,7 @@
public static function parse( array $headers, $body)
{
$response = json_decode( $body, true );
-
+
// To detect the type of the response from the couch DB server we use
// the response status which indicates the return type.
switch ( $headers['status'] )
@@ -146,7 +146,7 @@
// All other unhandled HTTP codes are for now handled as an
error.
// This may not be true, as lots of other status code may be
used
// for valid repsonses.
- throw new sfException( $response['error'] . ': ' .
$response['reason']);
+ throw new exception('sfCouch: ' . $response['error'] . ': ' .
$response['reason']);
}
}
}
\ No newline at end of file
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.