mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Apply minor changes to FilterRule function's error handling
This commit is contained in:
committed by
Dan Christian Bogos
parent
2252765e93
commit
3acc76474d
@@ -37,6 +37,11 @@
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"filters": {
|
||||
"apiers_conns": ["*internal"],
|
||||
},
|
||||
|
||||
|
||||
"rals": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"filters": {
|
||||
"apiers_conns": ["*internal"],
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
"general": {
|
||||
"log_level": 6,
|
||||
"log_level": 7,
|
||||
},
|
||||
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
"db_type": "*internal",
|
||||
},
|
||||
|
||||
"filters": {
|
||||
"apiers_conns": ["*localhost"],
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
"general": {
|
||||
"log_level": 6,
|
||||
"log_level": 7,
|
||||
},
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
"db_password": "",
|
||||
},
|
||||
|
||||
"filters": {
|
||||
"apiers_conns": ["*localhost"],
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
"general": {
|
||||
"log_level": 6,
|
||||
"log_level": 7,
|
||||
},
|
||||
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
"db_password": "CGRateS.org", // password to use when connecting to stordb
|
||||
},
|
||||
|
||||
"filters": {
|
||||
"apiers_conns": ["*localhost"],
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
},
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
"db_type": "*internal"
|
||||
},
|
||||
|
||||
"filters": {
|
||||
"apiers_conns": ["*localhost"],
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
"thresholds_conns": ["*localhost"]
|
||||
|
||||
@@ -527,6 +527,9 @@ func (fltr *FilterRule) passTimings(dDP utils.DataProvider) (bool, error) {
|
||||
if err = connMgr.Call(context.TODO(), config.CgrConfig().FilterSCfg().ApierSConns,
|
||||
utils.APIerSv1GetTiming,
|
||||
&utils.ArgsGetTimingID{ID: valTmID}, &tm); err != nil {
|
||||
if err.Error() != utils.ErrNotFound.Error() {
|
||||
return false, err
|
||||
}
|
||||
continue
|
||||
}
|
||||
ritm := &RITiming{
|
||||
@@ -558,6 +561,9 @@ func (fltr *FilterRule) passDestinations(dDP utils.DataProvider) (bool, error) {
|
||||
if err = connMgr.Call(context.TODO(), config.CgrConfig().FilterSCfg().ApierSConns,
|
||||
utils.APIerSv1GetReverseDestination,
|
||||
&p, &destIDs); err != nil {
|
||||
if err.Error() != utils.ErrNotFound.Error() {
|
||||
return false, err
|
||||
}
|
||||
continue
|
||||
}
|
||||
for _, dID := range destIDs {
|
||||
|
||||
@@ -2046,7 +2046,7 @@ func TestFiltersPassTimingsCallErr(t *testing.T) {
|
||||
}
|
||||
rcv, err := fltr.passTimings(dtP)
|
||||
|
||||
if err != nil {
|
||||
if err.Error() != "MANDATORY_IE_MISSING: [connIDs]" {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -2106,7 +2106,7 @@ func TestFiltersPassDestinationsCallErr(t *testing.T) {
|
||||
|
||||
rcv, err := fltr.passDestinations(dtP)
|
||||
|
||||
if err != nil {
|
||||
if err.Error() != "MANDATORY_IE_MISSING: [connIDs]" {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
@@ -2371,7 +2371,7 @@ func TestWeightFromDynamics(t *testing.T) {
|
||||
connMgr: nil,
|
||||
}
|
||||
|
||||
if _, err := WeightFromDynamics(dWs, fltrS, "cgrates.org", pEv); err != nil {
|
||||
if _, err := WeightFromDynamics(dWs, fltrS, "cgrates.org", pEv); err.Error() != "MANDATORY_IE_MISSING: [connIDs]" {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user