From 4540df80500feaaeb077f0db79e4fc35ef6f00f8 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Thu, 28 Jan 2016 11:18:31 +0200 Subject: [PATCH] better load rating info errors --- engine/calldesc.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/calldesc.go b/engine/calldesc.go index 2a4ccc69d..40fdb7e79 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -193,16 +193,18 @@ func (cd *CallDescriptor) LoadRatingPlans() (err error) { if err == utils.ErrNotFound && rec == 1 { //if err != nil || !cd.continousRatingInfos() { // use the default subject only if the initial one was not found + //utils.Logger.Debug(fmt.Sprintf("Try the default subject for %s and account: %s, subject: %s", cd.Destination, cd.GetAccountKey(), cd.GetKey(cd.Subject))) err, _ = cd.getRatingPlansForPrefix(cd.GetKey(FALLBACK_SUBJECT), 1) } //load the rating plans if err != nil { utils.Logger.Err(fmt.Sprintf("Rating plan not found for destination %s and account: %s, subject: %s", cd.Destination, cd.GetAccountKey(), cd.GetKey(cd.Subject))) - err = utils.ErrRatingPlanNotFound + return utils.ErrRatingPlanNotFound + } if !cd.continousRatingInfos() { utils.Logger.Err(fmt.Sprintf("Destination %s not authorized for account: %s, subject: %s", cd.Destination, cd.GetAccountKey(), cd.GetKey(cd.Subject))) - err = utils.ErrUnauthorizedDestination + return utils.ErrUnauthorizedDestination } return }