lib/srdb1: db_use_table() more suggestive error messages
authorDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 17 Sep 2020 10:55:10 +0000 (12:55 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 12 Oct 2020 08:07:47 +0000 (10:07 +0200)
(cherry picked from commit 57d33a2d76219ae3d1eb503044dadaeddc7e06fd)

src/lib/srdb1/db.c

index d33c939..54b66d3 100644 (file)
@@ -477,8 +477,12 @@ int db_check_table_version(db_func_t* dbf, db1_con_t* dbh, const str* table,
  */
 int db_use_table(db1_con_t* _h, const str* _t)
 {
-       if (!_h || !_t || !_t->s) {
-               LM_ERR("invalid parameter value\n");
+       if (!_h) {
+               LM_ERR("invalid connection parameter\n");
+               return -1;
+       }
+       if (!_t || !_t->s) {
+               LM_ERR("invalid table parameter value\n");
                return -1;
        }