Skip to content

Commit 3a34bef

Browse files
Use TruncatedStacktraces.jl
1 parent d783918 commit 3a34bef

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
3131
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
3232
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
3333
Tricks = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
34+
TruncatedStacktraces = "781d530d-4396-4725-bb49-402e4bee1e77"
3435
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"
3536

3637
[weakdeps]

src/DiffEqBase.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ using Static: reduce_tup
3030
import ChainRulesCore
3131
import RecursiveArrayTools
3232
import SparseArrays
33+
import TruncatedStacktraces
3334

3435
import ChainRulesCore: NoTangent, @non_differentiable
3536
import ZygoteRules

src/solve.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function Base.showerror(io::IO, e::CommonKwargError)
112112
print(io, "Unrecognized keyword arguments: ")
113113
printstyled(io, unrecognized; bold = true, color = :red)
114114
print(io, "\n\n")
115-
println(io, SciMLBase.VERBOSE_MSG)
115+
println(io, TruncatedStacktraces.VERBOSE_MSG)
116116
end
117117

118118
@enum KeywordArgError KeywordArgWarn KeywordArgSilent
@@ -138,7 +138,7 @@ struct IncompatibleInitialConditionError <: Exception end
138138

139139
function Base.showerror(io::IO, e::IncompatibleInitialConditionError)
140140
print(io, INCOMPATIBLE_U0_MESSAGE)
141-
println(io, SciMLBase.VERBOSE_MSG)
141+
println(io, TruncatedStacktraces.VERBOSE_MSG)
142142
end
143143

144144
const NO_DEFAULT_ALGORITHM_MESSAGE = """
@@ -155,7 +155,7 @@ struct NoDefaultAlgorithmError <: Exception end
155155

156156
function Base.showerror(io::IO, e::NoDefaultAlgorithmError)
157157
print(io, NO_DEFAULT_ALGORITHM_MESSAGE)
158-
println(io, SciMLBase.VERBOSE_MSG)
158+
println(io, TruncatedStacktraces.VERBOSE_MSG)
159159
end
160160

161161
const NO_TSPAN_MESSAGE = """
@@ -166,7 +166,7 @@ struct NoTspanError <: Exception end
166166

167167
function Base.showerror(io::IO, e::NoTspanError)
168168
print(io, NO_TSPAN_MESSAGE)
169-
println(io, SciMLBase.VERBOSE_MSG)
169+
println(io, TruncatedStacktraces.VERBOSE_MSG)
170170
end
171171

172172
const NON_SOLVER_MESSAGE = """
@@ -184,7 +184,7 @@ struct NonSolverError <: Exception end
184184

185185
function Base.showerror(io::IO, e::NonSolverError)
186186
print(io, NON_SOLVER_MESSAGE)
187-
println(io, SciMLBase.VERBOSE_MSG)
187+
println(io, TruncatedStacktraces.VERBOSE_MSG)
188188
end
189189

190190
const PROBSOLVER_PAIRING_MESSAGE = """
@@ -205,7 +205,7 @@ function Base.showerror(io::IO, e::ProblemSolverPairingError)
205205
println(io, "Solver type: $(SciMLBase.__parameterless_type(typeof(e.alg)))")
206206
println(io,
207207
"Problem types compatible with the chosen solver: $(compatible_problem_types(e.prob,e.alg))")
208-
println(io, SciMLBase.VERBOSE_MSG)
208+
println(io, TruncatedStacktraces.VERBOSE_MSG)
209209
end
210210

211211
function compatible_problem_types(prob, alg)
@@ -246,7 +246,7 @@ struct DirectAutodiffError <: Exception end
246246

247247
function Base.showerror(io::IO, e::DirectAutodiffError)
248248
println(io, DIRECT_AUTODIFF_INCOMPATABILITY_MESSAGE)
249-
println(io, SciMLBase.VERBOSE_MSG)
249+
println(io, TruncatedStacktraces.VERBOSE_MSG)
250250
end
251251

252252
const NONCONCRETE_ELTYPE_MESSAGE = """
@@ -280,7 +280,7 @@ end
280280
function Base.showerror(io::IO, e::NonConcreteEltypeError)
281281
print(io, NONCONCRETE_ELTYPE_MESSAGE)
282282
print(io, e.eltype)
283-
println(io, SciMLBase.VERBOSE_MSG)
283+
println(io, TruncatedStacktraces.VERBOSE_MSG)
284284
end
285285

286286
const GENERIC_NUMBER_TYPE_ERROR_MESSAGE = """
@@ -306,7 +306,7 @@ function Base.showerror(io::IO, e::GenericNumberTypeError)
306306
println(io, "Solver: $(e.alg)")
307307
println(io, "u0 type: $(e.uType)")
308308
print(io, "Timespan type: $(e.tType)")
309-
println(io, SciMLBase.VERBOSE_MSG)
309+
println(io, TruncatedStacktraces.VERBOSE_MSG)
310310
end
311311

312312
const COMPLEX_SUPPORT_ERROR_MESSAGE = """
@@ -325,7 +325,7 @@ end
325325
function Base.showerror(io::IO, e::ComplexSupportError)
326326
println(io, COMPLEX_SUPPORT_ERROR_MESSAGE)
327327
println(io, "Solver: $(e.alg)")
328-
println(io, SciMLBase.VERBOSE_MSG)
328+
println(io, TruncatedStacktraces.VERBOSE_MSG)
329329
end
330330

331331
const COMPLEX_TSPAN_ERROR_MESSAGE = """
@@ -340,7 +340,7 @@ struct ComplexTspanError <: Exception end
340340

341341
function Base.showerror(io::IO, e::ComplexTspanError)
342342
println(io, COMPLEX_TSPAN_ERROR_MESSAGE)
343-
println(io, SciMLBase.VERBOSE_MSG)
343+
println(io, TruncatedStacktraces.VERBOSE_MSG)
344344
end
345345

346346
const TUPLE_STATE_ERROR_MESSAGE = """
@@ -378,7 +378,7 @@ struct TupleStateError <: Exception end
378378

379379
function Base.showerror(io::IO, e::TupleStateError)
380380
println(io, TUPLE_STATE_ERROR_MESSAGE)
381-
println(io, SciMLBase.VERBOSE_MSG)
381+
println(io, TruncatedStacktraces.VERBOSE_MSG)
382382
end
383383

384384
const MASS_MATRIX_ERROR_MESSAGE = """
@@ -399,7 +399,7 @@ function Base.showerror(io::IO, e::IncompatibleMassMatrixError)
399399
println(io, e.sz)
400400
print(io, "length(u0): ")
401401
println(e.len)
402-
println(io, SciMLBase.VERBOSE_MSG)
402+
println(io, TruncatedStacktraces.VERBOSE_MSG)
403403
end
404404

405405
function init_call(_prob, args...; merge_callbacks = true, kwargshandle = KeywordArgWarn,
@@ -1399,7 +1399,7 @@ struct AdjointNotFoundError <: Exception end
13991399

14001400
function Base.showerror(io::IO, e::AdjointNotFoundError)
14011401
print(io, ADJOINT_NOT_FOUND_MESSAGE)
1402-
println(io, SciMLBase.VERBOSE_MSG)
1402+
println(io, TruncatedStacktraces.VERBOSE_MSG)
14031403
end
14041404

14051405
function _concrete_solve_adjoint(args...; kwargs...)
@@ -1416,7 +1416,7 @@ struct ForwardSensitivityNotFoundError <: Exception end
14161416

14171417
function Base.showerror(io::IO, e::ForwardSensitivityNotFoundError)
14181418
print(io, FORWARD_SENSITIVITY_NOT_FOUND_MESSAGE)
1419-
println(io, SciMLBase.VERBOSE_MSG)
1419+
println(io, TruncatedStacktraces.VERBOSE_MSG)
14201420
end
14211421

14221422
function _concrete_solve_forward(args...; kwargs...)

0 commit comments

Comments
 (0)