Skip to content

Commit 03a7b0b

Browse files
committed
custom exception type
1 parent 71e81cc commit 03a7b0b

File tree

4 files changed

+402
-393
lines changed

4 files changed

+402
-393
lines changed

src/systems/abstractsystem.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,6 +2300,13 @@ function Base.showerror(io::IO, e::ExtraEquationsSystemException)
23002300
print(io, "ExtraEquationsSystemException: ", e.msg)
23012301
end
23022302

2303+
struct HybridSystemNotSupportedExcpetion <: Exception
2304+
msg::String
2305+
end
2306+
function Base.showerror(io::IO, e::HybridSystemNotSupportedExcpetion)
2307+
print(io, "HybridSystemNotSupportedExcpetion: ", e.msg)
2308+
end
2309+
23032310
function AbstractTrees.children(sys::ModelingToolkit.AbstractSystem)
23042311
ModelingToolkit.get_systems(sys)
23052312
end

src/systems/systemstructure.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ function structural_simplify!(state::TearingState, io = nothing; simplify = fals
637637
kwargs...)
638638
if length(tss) > 1
639639
if continuous_id > 0
640-
error("Hybrid continuous-discrete systems are currently not supported with the standard MTK compiler. This system requires JuliaSimCompiler.jl, see https://help.juliahub.com/juliasimcompiler/stable/")
640+
throw(HybridSystemNotSupportedExcpetion("Hybrid continuous-discrete systems are currently not supported with the standard MTK compiler. This system requires JuliaSimCompiler.jl, see https://help.juliahub.com/juliasimcompiler/stable/"))
641641
end
642642
# TODO: rename it to something else
643643
discrete_subsystems = Vector{ODESystem}(undef, length(tss))

0 commit comments

Comments
 (0)