Skip to content

Commit cd0bfcd

Browse files
Merge pull request #1127 from AayushSabharwal/as/outdated-error
fix: remove usages of TruncatedStacktraces
2 parents 157c43f + 85accec commit cd0bfcd

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

src/errors.jl

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ function Base.showerror(io::IO, e::CommonKwargError)
120120
unrecognized = collect(keys(e.kwargs))[notin]
121121
print(io, "Unrecognized keyword arguments: ")
122122
printstyled(io, unrecognized; bold = true, color = :red)
123-
print(io, "\n\n")
124-
println(io, TruncatedStacktraces.VERBOSE_MSG)
125123
end
126124

127125
@enum KeywordArgError KeywordArgWarn KeywordArgSilent
@@ -147,7 +145,6 @@ struct IncompatibleInitialConditionError <: Exception end
147145

148146
function Base.showerror(io::IO, e::IncompatibleInitialConditionError)
149147
print(io, INCOMPATIBLE_U0_MESSAGE)
150-
println(io, TruncatedStacktraces.VERBOSE_MSG)
151148
end
152149

153150
const NO_DEFAULT_ALGORITHM_MESSAGE = """
@@ -164,7 +161,6 @@ struct NoDefaultAlgorithmError <: Exception end
164161

165162
function Base.showerror(io::IO, e::NoDefaultAlgorithmError)
166163
print(io, NO_DEFAULT_ALGORITHM_MESSAGE)
167-
println(io, TruncatedStacktraces.VERBOSE_MSG)
168164
end
169165

170166
const NO_TSPAN_MESSAGE = """
@@ -175,7 +171,6 @@ struct NoTspanError <: Exception end
175171

176172
function Base.showerror(io::IO, e::NoTspanError)
177173
print(io, NO_TSPAN_MESSAGE)
178-
println(io, TruncatedStacktraces.VERBOSE_MSG)
179174
end
180175

181176
const NAN_TSPAN_MESSAGE = """
@@ -189,7 +184,6 @@ struct NaNTspanError <: Exception end
189184

190185
function Base.showerror(io::IO, e::NaNTspanError)
191186
print(io, NAN_TSPAN_MESSAGE)
192-
println(io, TruncatedStacktraces.VERBOSE_MSG)
193187
end
194188

195189
const NON_SOLVER_MESSAGE = """
@@ -207,7 +201,6 @@ struct NonSolverError <: Exception end
207201

208202
function Base.showerror(io::IO, e::NonSolverError)
209203
print(io, NON_SOLVER_MESSAGE)
210-
println(io, TruncatedStacktraces.VERBOSE_MSG)
211204
end
212205

213206
const NOISE_SIZE_MESSAGE = """
@@ -235,7 +228,6 @@ function Base.showerror(io::IO, e::NoiseSizeIncompatabilityError)
235228
println(io, NOISE_SIZE_MESSAGE)
236229
println(io, "size(prob.noise_rate_prototype,2) = $(e.prototypesize)")
237230
println(io, "length(prob.noise.W[1]) = $(e.noisesize)")
238-
println(io, TruncatedStacktraces.VERBOSE_MSG)
239231
end
240232

241233
const PROBSOLVER_PAIRING_MESSAGE = """
@@ -256,7 +248,6 @@ function Base.showerror(io::IO, e::ProblemSolverPairingError)
256248
println(io, "Solver type: $(SciMLBase.__parameterless_type(typeof(e.alg)))")
257249
println(io,
258250
"Problem types compatible with the chosen solver: $(compatible_problem_types(e.prob,e.alg))")
259-
println(io, TruncatedStacktraces.VERBOSE_MSG)
260251
end
261252

262253
function compatible_problem_types(prob, alg)
@@ -297,7 +288,6 @@ struct DirectAutodiffError <: Exception end
297288

298289
function Base.showerror(io::IO, e::DirectAutodiffError)
299290
println(io, DIRECT_AUTODIFF_INCOMPATABILITY_MESSAGE)
300-
println(io, TruncatedStacktraces.VERBOSE_MSG)
301291
end
302292

303293
const NONNUMBER_ELTYPE_MESSAGE = """
@@ -336,7 +326,6 @@ end
336326
function Base.showerror(io::IO, e::NonNumberEltypeError)
337327
print(io, NONNUMBER_ELTYPE_MESSAGE)
338328
print(io, e.eltype)
339-
println(io, TruncatedStacktraces.VERBOSE_MSG)
340329
end
341330

342331
const GENERIC_NUMBER_TYPE_ERROR_MESSAGE = """
@@ -362,7 +351,6 @@ function Base.showerror(io::IO, e::GenericNumberTypeError)
362351
println(io, "Solver: $(e.alg)")
363352
println(io, "u0 type: $(e.uType)")
364353
print(io, "Timespan type: $(e.tType)")
365-
println(io, TruncatedStacktraces.VERBOSE_MSG)
366354
end
367355

368356
const COMPLEX_SUPPORT_ERROR_MESSAGE = """
@@ -381,7 +369,6 @@ end
381369
function Base.showerror(io::IO, e::ComplexSupportError)
382370
println(io, COMPLEX_SUPPORT_ERROR_MESSAGE)
383371
println(io, "Solver: $(e.alg)")
384-
println(io, TruncatedStacktraces.VERBOSE_MSG)
385372
end
386373

387374
const COMPLEX_TSPAN_ERROR_MESSAGE = """
@@ -396,7 +383,6 @@ struct ComplexTspanError <: Exception end
396383

397384
function Base.showerror(io::IO, e::ComplexTspanError)
398385
println(io, COMPLEX_TSPAN_ERROR_MESSAGE)
399-
println(io, TruncatedStacktraces.VERBOSE_MSG)
400386
end
401387

402388
const TUPLE_STATE_ERROR_MESSAGE = """
@@ -434,7 +420,6 @@ struct TupleStateError <: Exception end
434420

435421
function Base.showerror(io::IO, e::TupleStateError)
436422
println(io, TUPLE_STATE_ERROR_MESSAGE)
437-
println(io, TruncatedStacktraces.VERBOSE_MSG)
438423
end
439424

440425
const MASS_MATRIX_ERROR_MESSAGE = """
@@ -455,7 +440,6 @@ function Base.showerror(io::IO, e::IncompatibleMassMatrixError)
455440
println(io, e.sz)
456441
print(io, "length(u0): ")
457442
println(e.len)
458-
println(io, TruncatedStacktraces.VERBOSE_MSG)
459443
end
460444

461445
const LATE_BINDING_TSTOPS_ERROR_MESSAGE = """
@@ -468,5 +452,4 @@ struct LateBindingTstopsNotSupportedError <: Exception end
468452

469453
function Base.showerror(io::IO, e::LateBindingTstopsNotSupportedError)
470454
println(io, LATE_BINDING_TSTOPS_ERROR_MESSAGE)
471-
println(io, TruncatedStacktraces.VERBOSE_MSG)
472-
end
455+
end

src/solve.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ end
2929
function Base.showerror(io::IO, e::NonConcreteEltypeError)
3030
print(io, NONCONCRETE_ELTYPE_MESSAGE)
3131
print(io, e.eltype)
32-
println(io, TruncatedStacktraces.VERBOSE_MSG)
3332
end
3433

3534
# Skip the DiffEqBase handling
@@ -531,7 +530,6 @@ struct AdjointNotFoundError <: Exception end
531530

532531
function Base.showerror(io::IO, e::AdjointNotFoundError)
533532
print(io, ADJOINT_NOT_FOUND_MESSAGE)
534-
println(io, TruncatedStacktraces.VERBOSE_MSG)
535533
end
536534

537535
function _concrete_solve_adjoint(args...; kwargs...)
@@ -548,9 +546,8 @@ struct ForwardSensitivityNotFoundError <: Exception end
548546

549547
function Base.showerror(io::IO, e::ForwardSensitivityNotFoundError)
550548
print(io, FORWARD_SENSITIVITY_NOT_FOUND_MESSAGE)
551-
println(io, TruncatedStacktraces.VERBOSE_MSG)
552549
end
553550

554551
function _concrete_solve_forward(args...; kwargs...)
555552
throw(ForwardSensitivityNotFoundError())
556-
end
553+
end

0 commit comments

Comments
 (0)