mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 02:26:26 +05:00
refined error messages
This commit is contained in:
@@ -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{},
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user