Skip to content

Commit

Permalink
Improved error MandatoryIeMissing
Browse files Browse the repository at this point in the history
  • Loading branch information
adragusin authored and danbogos committed Mar 13, 2020
1 parent fdcf0af commit 29ac72d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apier/v1/attributes_it_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
8 changes: 4 additions & 4 deletions engine/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,17 +346,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
}
}
Expand Down

0 comments on commit 29ac72d

Please sign in to comment.