Skip to content

Commit b25e64a

Browse files
Merge pull request #3000 from AayushSabharwal/as/better-errors
refactor: improve error messages for under- and over-determined systems
2 parents 2813251 + c00c693 commit b25e64a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/systems/abstractsystem.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,14 +2747,20 @@ struct ExtraVariablesSystemException <: Exception
27472747
msg::String
27482748
end
27492749
function Base.showerror(io::IO, e::ExtraVariablesSystemException)
2750-
print(io, "ExtraVariablesSystemException: ", e.msg)
2750+
println(io, "ExtraVariablesSystemException: ", e.msg)
2751+
print(io,
2752+
"Note that the process of determining extra variables is a best-effort heuristic. " *
2753+
"The true extra variables are dependent on the model and may not be in this list.")
27512754
end
27522755

27532756
struct ExtraEquationsSystemException <: Exception
27542757
msg::String
27552758
end
27562759
function Base.showerror(io::IO, e::ExtraEquationsSystemException)
2757-
print(io, "ExtraEquationsSystemException: ", e.msg)
2760+
println(io, "ExtraEquationsSystemException: ", e.msg)
2761+
print(io,
2762+
"Note that the process of determining extra equations is a best-effort heuristic. " *
2763+
"The true extra equations are dependent on the model and may not be in this list.")
27582764
end
27592765

27602766
struct HybridSystemNotSupportedException <: Exception

0 commit comments

Comments
 (0)