diff --git a/src/db.c b/src/db.c
index a97a244cae680d57b0e3c2f8528f261b4885670c..4fa04075b47dcc5b2d68ad9c4000c1fc57c5f22b 100644
--- a/src/db.c
+++ b/src/db.c
@@ -206,7 +206,7 @@ static PyObject *pyalpm_db_update(PyObject *rawself, PyObject *args, PyObject *k
 
   switch(ret) {
   case -1:
-    RET_ERR("unable to update database", 0, NULL);
+    RET_ERR("unable to update database", alpm_errno(handle), NULL);
   case 0:
     Py_RETURN_TRUE;
   case 1: