From 832046d38311ff0a4578e05bf20681b3f796e5f6 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Mon, 15 Jan 2018 16:12:37 +0100 Subject: [PATCH] Improve an error message in db_init(). If we cannot open a connection to the sqlite3 database, show the name of the database we failed to access, and also hint at the fact that a likely reason for the problem is a missing sqlite3 driver for libdbi. Change-Id: If1c0026e882984b4358ce116ec4a7ad40340517c --- src/libmsc/db.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 28004f7e4..7007c7af1 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -614,7 +614,8 @@ int db_init(const char *name) conn = dbi_conn_new_r("sqlite3", inst); if (conn == NULL) { - LOGP(DDB, LOGL_FATAL, "Failed to create connection.\n"); + LOGP(DDB, LOGL_FATAL, "Failed to create database connection to sqlite3 db '%s'; " + "Is the sqlite3 database driver for libdbi installed on this system?\n", name); return 1; }