Skip to content

Commit a347d10

Browse files
committed
Fix error reporting
Interpolate types so the modules don't need to be imported add MethodError case
1 parent f521f6d commit a347d10

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/systems/model_parsing.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,10 @@ function parse_variable_arg(dict, mod, arg, varclass, kwargs, where_types)
639639
try
640640
$setdefault($vv, $convert_units($unit, $name))
641641
catch e
642-
if isa(e, DynamicQuantities.DimensionError) || isa(e, Unitful.DimensionError)
642+
if isa(e, $(DynamicQuantities.DimensionError)) || isa(e, $(Unitful.DimensionError))
643643
error("Unable to convert units for \'"*string(:($$vv))*"\'")
644+
elseif isa(e, MethodError)
645+
error("No or invalid units provided for \'"*string(:($$vv))*"\'")
644646
else
645647
rethrow(e)
646648
end

0 commit comments

Comments
 (0)