diff --git a/dmemcache.inc b/dmemcache.inc
index b634c25..e1704bc 100644
--- a/dmemcache.inc
+++ b/dmemcache.inc
@@ -342,15 +342,24 @@ function dmemcache_object($bin = NULL, $flush = FALSE) {
 
           // Using the Memcache PECL extension.
           if ($memcache instanceof Memcache) {
-            // When using the PECL memcache extension, we must use ->(p)connect 
+            // When using the PECL memcache extension, we must use ->(p)connect
             // for the first connection.
             if (!$init) {
-              if ($memcache_persistent && $memcache->pconnect($host, $port)) {
+              $track_errors = ini_set('track_errors', '1');
+              $php_errormsg = '';
+
+              if ($memcache_persistent && @$memcache->pconnect($host, $port)) {
                 $init = TRUE;
               }
-              elseif (!$memcache_persistent && $memcache->connect($host, $port)) {
+              elseif (!$memcache_persistent && @$memcache->connect($host, $port)) {
                 $init = TRUE;
               }
+
+              if (!empty($php_errormsg)) {
+                register_shutdown_function('watchdog', 'memcache', 'Exception caught: !msg', array('!msg' => $php_errormsg), WATCHDOG_WARNING);
+                $php_errormsg = '';
+              }
+              ini_set('track_errors', $track_errors);
             }
             else {
               $memcache->addServer($host, $port, $memcache_persistent);
