Skip to content

Commit 578bbc8

Browse files
authored
TD-818: Fixes to explanations (#117)
1 parent 3c9ab24 commit 578bbc8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

apps/routing/src/hg_routing_explanation.erl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,18 @@ route_explanation(candidate, RouteWithContext, ChosenRoute) ->
127127
}.
128128

129129
candidate_rejection_explanation(
130-
#{scores := RouteScores, limits := RouteLimits},
131-
#{scores := ChosenScores}
132-
) when RouteScores =:= undefined; RouteLimits =:= undefined; ChosenScores =:= undefined ->
130+
#{scores := undefined, limits := undefined},
131+
_ChosenRoute
132+
) ->
133133
<<"Not enough information to make judgement. Payment was done before relevant changes were done.">>;
134+
candidate_rejection_explanation(
135+
#{scores := undefined, limits := RouteLimits},
136+
_ChosenRoute
137+
) ->
138+
IfEmpty =
139+
<<"We only know about limits for this route, but no limit",
140+
" was reached, if you see this message contact developer.">>,
141+
check_route_limits(RouteLimits, IfEmpty);
134142
candidate_rejection_explanation(
135143
#{scores := RouteScores, limits := RouteLimits},
136144
#{scores := ChosenScores}
@@ -215,7 +223,7 @@ check_route_scores(
215223
terminal_priority_rating = Rating1
216224
}
217225
) when Rating0 < Rating1 ->
218-
format("Priority of this route was less chosen one, where ~p < ~p.", [Rating0, Rating1]);
226+
format("Priority of this route was less than in chosen route, where ~p < ~p.", [Rating0, Rating1]);
219227
check_route_scores(
220228
#domain_PaymentRouteScores{
221229
route_pin = Pin0

0 commit comments

Comments
 (0)