Browse code

lib/srdb1: db_use_table() more suggestive error messages

(cherry picked from commit 57d33a2d76219ae3d1eb503044dadaeddc7e06fd)

Daniel-Constantin Mierla authored on 17/09/2020 10:55:10 • Henning Westerholt committed on 02/10/2020 15:59:02
Showing 1 changed files
... ...
@@ -468,8 +468,12 @@ int db_check_table_version(db_func_t* dbf, db1_con_t* dbh, const str* table,
468 468
  */
469 469
 int db_use_table(db1_con_t* _h, const str* _t)
470 470
 {
471
-	if (!_h || !_t || !_t->s) {
472
-		LM_ERR("invalid parameter value\n");
471
+	if (!_h) {
472
+		LM_ERR("invalid connection parameter\n");
473
+		return -1;
474
+	}
475
+	if (!_t || !_t->s) {
476
+		LM_ERR("invalid table parameter value\n");
473 477
 		return -1;
474 478
 	}
475 479