Skip to content

Commit 14b0088

Browse files
committed
Better error msg
1 parent 3fbf453 commit 14b0088

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/systems/diffeqs/odesystem.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ function build_explicit_observed_function(
235235
# FIXME: this is a rather rough estimate of dependencies.
236236
maxidx = 0
237237
for (i, s) in enumerate(syms)
238-
idx = observed_idx[s]
238+
idx = get(observed_idx, s, nothing)
239+
idx === nothing && throw(ArgumentError("$s is not an observed variable."))
239240
idx > maxidx && (maxidx = idx)
240241
output[i] = obs[idx].rhs
241242
end

0 commit comments

Comments
 (0)