diff --git a/console/scheduler_queue.go b/console/scheduler_queue.go index 079575373..c91eb92a7 100644 --- a/console/scheduler_queue.go +++ b/console/scheduler_queue.go @@ -22,7 +22,7 @@ import "github.com/cgrates/cgrates/apier/v1" func init() { c := &CmdGetScheduledActions{ - name: "scheduler_queue", + name: "2", rpcMethod: "ApierV1.GetScheduledActions", rpcParams: &v1.AttrsGetScheduledActions{}, } diff --git a/engine/action.go b/engine/action.go index 79e0df5df..fdf0eaff1 100644 --- a/engine/action.go +++ b/engine/action.go @@ -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 diff --git a/engine/calldesc.go b/engine/calldesc.go index 7ceb823f2..46771baa4 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -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 } diff --git a/utils/consts.go b/utils/consts.go index 5eddb8d00..345408b29 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -13,10 +13,6 @@ func NewErrServerError(err error) error { return fmt.Errorf("SERVER_ERROR: %s", err) } -func NewErrAccountNotFound(accID, context string) error { - return fmt.Errorf("ACCOUNT_NOT_FOUND: %s in %s", accID, context) -} - var ( ErrNotImplemented = errors.New("NOT_IMPLEMENTED") ErrNotFound = errors.New("NOT_FOUND") @@ -30,7 +26,8 @@ var ( ErrInvalidPath = errors.New("INVALID_PATH") ErrInvalidKey = errors.New("INVALID_KEY") ErrUnauthorizedDestination = errors.New("UNAUTHORIZED_DESTINATION") - ErrAccountNotFound = errors.New("AccountNotFound") + ErrRatingPlanNotFound = errors.New("RATING_PLAN_NOT_FOUND") + ErrAccountNotFound = errors.New("ACCOUNT_NOT_FOUND") ) const (