diff --git a/Connection.php b/Connection.php index fc56f03..77180f2 100644 --- a/Connection.php +++ b/Connection.php @@ -288,6 +288,11 @@ public function evalString($string, $parser = self::PARSER_NATIVE) { if( !$r['is_error'] ) { return $this->parseResponse($r['contents'], $parser); } + + if(strpos($r['contents'], "R warning:") == 0) { + throw new Rserve_Warning($r); + } + throw new Rserve_Exception('unable to evaluate', $r); } @@ -578,5 +583,8 @@ public function __construct($message, $packet=NULL) { class Rserve_Parser_Exception extends Rserve_Exception { } +class Rserve_Warning extends Rserve_Exception { +} + Rserve_Connection::init();