Permalink
Browse files

improvexd exception message (fixed issue #5). Thanks to MrTrick

  • Loading branch information...
1 parent bb9ec47 commit 17509cbda37ee738fc8498f90bf7e256e9ae5b7d @dready92 committed May 31, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/couchClient.php
View
@@ -904,7 +904,11 @@ class couchException extends Exception {
*/
function __construct($raw_response) {
$this->couch_response = couch::parseRawResponse($raw_response);
- parent::__construct($this->couch_response['status_message'], $this->couch_response['status_code']);
+ if ( is_object($this->couch_response['body']) and isset($this->couch_response['body']->reason) )
+ $message = $this->couch_response['status_message'] . ' - ' . $this->couch_response['body']->reason;
+ else
+ $message = $this->couch_response['status_message'];
+ parent::__construct($message , $this->couch_response['status_code']);
}
/**

0 comments on commit 17509cb

Please sign in to comment.