Skip to content

Commit 00520c3

Browse files
committed
Tweak error message when value not found
1 parent b4f69b1 commit 00520c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/AbstractPPLDistributionsExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function AbstractPPL.hasvalue(
177177
else
178178
if error_on_incomplete &&
179179
any(sub_vn -> AbstractPPL.hasvalue(vals, sub_vn), expected_vns)
180-
error("hasvalue: only partial values for `$vn` found in the values provided")
180+
error("only partial values for `$vn` found in the dictionary provided")
181181
end
182182
return false
183183
end
@@ -269,7 +269,7 @@ function AbstractPPL.getvalue(
269269
end
270270
return value
271271
else
272-
error("getvalue: $(vn) was not found in the values provided")
272+
error("$(vn) was not found in the dictionary provided")
273273
end
274274
end
275275

src/hasvalue.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function getvalue(vals::NamedTuple, vn::VarName{sym}) where {sym}
135135
if haskey(vals, sym) && canview(optic, getproperty(vals, sym))
136136
return optic(vals[sym])
137137
else
138-
error("getvalue: $(vn) was not found in the values provided")
138+
error("$(vn) was not found in the NamedTuple provided")
139139
end
140140
end
141141

@@ -165,7 +165,7 @@ function getvalue(vals::AbstractDict{<:VarName}, vn::VarName{sym}) where {sym}
165165
# Try to move the outermost optic from test_vn into test_optic.
166166
# If test_vn is already an identity, we can't, so we stop.
167167
o = getoptic(test_vn)
168-
o == identity && error("getvalue: $(vn) was not found in the values provided")
168+
o == identity && error("$(vn) was not found in the dictionary provided")
169169
test_vn = VarName{sym}(_init(o))
170170
test_optic = normalise(test_optic _last(o))
171171
end

0 commit comments

Comments
 (0)