mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 22:29:55 +05:00
no account protection (*transfer_monetary_default)
This commit is contained in:
@@ -604,6 +604,9 @@ 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")
|
||||
}
|
||||
if _, exists := acc.BalanceMap[utils.MONETARY]; !exists {
|
||||
return utils.ErrNotFound
|
||||
}
|
||||
|
||||
@@ -13,6 +13,10 @@ 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")
|
||||
|
||||
Reference in New Issue
Block a user