]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add OCP\DB::getErrorMessage() to public namespace.
authorThomas Tanghus <thomas@tanghus.net>
Mon, 16 Sep 2013 00:17:39 +0000 (02:17 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Mon, 16 Sep 2013 00:17:39 +0000 (02:17 +0200)
lib/public/db.php

index 932e79d9ef1755828ea34751881911d47a3ad4e2..9512cca2d19d30398eb85de376b80fef6630b686 100644 (file)
@@ -102,4 +102,15 @@ class DB {
        public static function isError($result) {
                return(\OC_DB::isError($result));
        }
+
+       /**
+        * returns the error code and message as a string for logging
+        * works with DoctrineException
+        * @param mixed $error
+        * @return string
+        */
+       public static function getErrorMessage($error) {
+               return(\OC_DB::getErrorMessage($error));
+       }
+
 }