Improved error MandatoryIeMissing

This commit is contained in:
adragusin
2020-03-13 12:12:22 +02:00
committed by Dan Christian Bogos
parent 5fd198bf71
commit d2fff7d7a5
2 changed files with 5 additions and 5 deletions

View File

@@ -413,7 +413,7 @@ func testAttributeSProcessEventMissing(t *testing.T) {
var rplyEv engine.AttrSProcessEventReply
if err := attrSRPC.Call(utils.AttributeSv1ProcessEvent,
ev, &rplyEv); err == nil ||
err.Error() != utils.ErrMandatoryIeMissing.Error() {
err.Error() != "MANDATORY_IE_MISSING: [Category]" {
t.Error(err)
}
}

View File

@@ -398,17 +398,17 @@ func (alS *AttributeService) V1ProcessEvent(args *AttrArgsProcessEvent,
}
// Make sure the requested fields were populated
if err == utils.ErrNotFound {
for _, valIface := range args.CGREvent.Event {
for val, valIface := range args.CGREvent.Event {
if valIface == interface{}(utils.MetaAttributes) {
err = utils.ErrMandatoryIeMissing
err = utils.NewErrMandatoryIeMissing(val)
break
}
}
} else if err == nil {
for _, valIface := range apiRply.CGREvent.Event {
for val, valIface := range apiRply.CGREvent.Event {
if valIface == interface{}(utils.MetaAttributes) {
// mandatory IE missing
err = utils.ErrMandatoryIeMissing
err = utils.NewErrMandatoryIeMissing(val)
break
}
}