Skip to content

Commit

Permalink
Merge pull request #19 from andy89923/fix/error-handling
Browse files Browse the repository at this point in the history
fix: error handling in RatingFunction
  • Loading branch information
ianchen0119 authored Mar 22, 2024
2 parents ab9baa7 + e439941 commit fb015d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/rf/rating.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ func handleSUR() diam.HandlerFunc {
if err != nil {
logger.ChargingdataPostLog.Errorf("Get tarrif error: %+v", err)
}

if chargingInterface == nil {
logger.ChargingdataPostLog.Warningf(
"No ChargingData found for UE:[%+v] for RG:[%+v]", subscriberId, rg)
return
}
unitCostStr := chargingInterface["unitCost"].(string)
monetaryTariff := buildTaffif(unitCostStr)
unitCost := datatype.Unsigned32(monetaryTariff.RateElement.UnitCost.ValueDigits) *
Expand Down

0 comments on commit fb015d1

Please sign in to comment.