Skip to content

Commit

Permalink
add control_state to validation error message
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Nov 10, 2023
1 parent a52d490 commit f9304a9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/src/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,21 @@ function valid_fractional_flow(
if fraction <= 0
errors = true
@error(

Check warning on line 591 in core/src/validation.jl

View check run for this annotation

Codecov / codecov/patch

core/src/validation.jl#L590-L591

Added lines #L590 - L591 were not covered by tests
"Fractional flow nodes must have non-negative fractions, got $fraction for #$ff_id."
"Fractional flow nodes must have non-negative fractions.",
fraction,
node_id = ff_id,
control_state,
)
end
end

if fraction_sum 1
errors = true
@error(
"The sum of fractional flow fractions leaving a node must be ≈1, got $fraction_sum for #$src_id."
"The sum of fractional flow fractions leaving a node must be ≈1.",
fraction_sum,
node_id = src_id,
control_state,
)
end
end
Expand Down

0 comments on commit f9304a9

Please sign in to comment.