Skip to content

Commit

Permalink
cachedb: Improve error reporting for bad connect strings
Browse files Browse the repository at this point in the history
Based on an original report+patch provided by @jalung on GitHub.
  • Loading branch information
liviuchircu authored and razvancrainea committed Nov 22, 2017
1 parent 847c83e commit 2d0425a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cachedb/cachedb.c
Expand Up @@ -334,7 +334,7 @@ int cachedb_remove(str* cachedb_name, str* attr)

con = cachedb_get_connection(cde,&grp_name);
if (con == NULL) {
LM_ERR("failed to get connection for grp name [%.*s]\n",
LM_ERR("failed to get connection for grp name [%.*s] : check db_url\n",
grp_name.len,grp_name.s);
return -1;
}
Expand Down Expand Up @@ -387,7 +387,7 @@ int cachedb_store(str* cachedb_name, str* attr, str* val,int expires)

con = cachedb_get_connection(cde,&grp_name);
if (con == NULL) {
LM_ERR("failed to get connection for grp name [%.*s]\n",
LM_ERR("failed to get connection for grp name [%.*s] : check db_url\n",
grp_name.len,grp_name.s);
return -1;
}
Expand Down Expand Up @@ -440,7 +440,7 @@ int cachedb_fetch(str* cachedb_name, str* attr, str* val)

con = cachedb_get_connection(cde,&grp_name);
if (con == NULL) {
LM_ERR("failed to get connection for grp name [%.*s]\n",
LM_ERR("failed to get connection for grp name [%.*s] : check db_url\n",
grp_name.len,grp_name.s);
return -1;
}
Expand Down Expand Up @@ -493,7 +493,7 @@ int cachedb_counter_fetch(str* cachedb_name, str* attr, int* val)

con = cachedb_get_connection(cde,&grp_name);
if (con == NULL) {
LM_ERR("failed to get connection for grp name [%.*s]\n",
LM_ERR("failed to get connection for grp name [%.*s] : check db_url\n",
grp_name.len,grp_name.s);
return -1;
}
Expand Down Expand Up @@ -552,7 +552,7 @@ int cachedb_add(str* cachedb_name, str* attr, int val,int expires,int *new_val)

con = cachedb_get_connection(cde,&grp_name);
if (con == NULL) {
LM_ERR("failed to get connection for grp name [%.*s]\n",
LM_ERR("failed to get connection for grp name [%.*s] : check db_url\n",
grp_name.len,grp_name.s);
return -1;
}
Expand Down Expand Up @@ -611,7 +611,7 @@ int cachedb_sub(str* cachedb_name, str* attr, int val,int expires,int *new_val)

con = cachedb_get_connection(cde,&grp_name);
if (con == NULL) {
LM_ERR("failed to get connection for grp name [%.*s]\n",
LM_ERR("failed to get connection for grp name [%.*s] : check db_url\n",
grp_name.len,grp_name.s);
return -1;
}
Expand Down Expand Up @@ -742,7 +742,7 @@ int cachedb_raw_query(str* cachedb_name, str* attr, cdb_raw_entry*** reply,int e

con = cachedb_get_connection(cde,&grp_name);
if (con == NULL) {
LM_ERR("failed to get connection for grp name [%.*s]\n",
LM_ERR("failed to get connection for grp name [%.*s] : check db_url\n",
grp_name.len,grp_name.s);
return -1;
}
Expand Down

0 comments on commit 2d0425a

Please sign in to comment.