From 59b73621d5ba43076b9dfd91b79472e7a5c3f03f Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Wed, 19 Aug 2015 12:25:51 +0300 Subject: [PATCH] guard on remove rating profile api --- apier/v1/apier.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apier/v1/apier.go b/apier/v1/apier.go index f042b6c82..1194bc291 100644 --- a/apier/v1/apier.go +++ b/apier/v1/apier.go @@ -1169,7 +1169,13 @@ func (self *ApierV1) RemoveRatingProfile(attr AttrRemoveRatingProfile, reply *st if attr.Tennat != "" && attr.Direction == "" { return fmt.Errorf("%s:%s", utils.ErrMandatoryIeMissing.Error(), "Direction") } - err := self.RatingDb.RemoveRatingProfile(attr.GetId()) + _, err := engine.Guardian.Guard(func() (interface{}, error) { + err := self.RatingDb.RemoveRatingProfile(attr.GetId()) + if err != nil { + return 0, err + } + return 0, nil + }, "RemoveRatingProfile") if err != nil { *reply = err.Error() return err