refined error messages

This commit is contained in:
Radu Ioan Fericean
2016-01-18 17:22:18 +02:00
parent f097ac8646
commit e0c8ea02c5
4 changed files with 10 additions and 8 deletions

View File

@@ -605,7 +605,8 @@ func removeBalanceAction(ub *Account, sq *StatsQueueTriggered, a *Action, acs Ac
func transferMonetaryDefault(acc *Account, sq *StatsQueueTriggered, a *Action, acs Actions) error {
if acc == nil {
return utils.NewErrAccountNotFound("", "*transfer_monetary_default")
utils.Logger.Err("*transfer_monetary_default called without account")
return utils.ErrAccountNotFound
}
if _, exists := acc.BalanceMap[utils.MONETARY]; !exists {
return utils.ErrNotFound

View File

@@ -195,7 +195,11 @@ func (cd *CallDescriptor) LoadRatingPlans() (err error) {
err, _ = cd.getRatingPlansForPrefix(cd.GetKey(FALLBACK_SUBJECT), 1)
}
//load the rating plans
if err != nil || !cd.continousRatingInfos() {
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
}
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
}