SMGeneric error handling fixes

This commit is contained in:
DanB
2016-03-17 19:11:48 +01:00
parent 6518d5c422
commit f8269bcccf
2 changed files with 8 additions and 2 deletions

View File

@@ -170,11 +170,14 @@ func (self *SMGeneric) GetLcrSuppliers(gev SMGenericEvent, clnt *rpc2.Client) ([
// Execute debits for usage/maxUsage
func (self *SMGeneric) SessionUpdate(gev SMGenericEvent, clnt *rpc2.Client) (time.Duration, error) {
evLastUsed, err := gev.GetLastUsed(utils.META_DEFAULT)
if err != nil {
if err != nil && err != utils.ErrNotFound {
return nilDuration, err
}
evMaxUsage, err := gev.GetMaxUsage(utils.META_DEFAULT, self.cgrCfg.MaxCallDuration)
if err != nil {
if err == utils.ErrNotFound {
err = utils.ErrMandatoryIeMissing
}
return nilDuration, err
}
evUuid := gev.GetUUID()
@@ -206,6 +209,9 @@ func (self *SMGeneric) SessionEnd(gev SMGenericEvent, clnt *rpc2.Client) error {
}
lastUsed, err := gev.GetLastUsed(utils.META_DEFAULT)
if err != nil {
if err == utils.ErrNotFound {
err = utils.ErrMandatoryIeMissing
}
return err
}
var s *SMGSession