From cad39c5c5700d36885fe2c2224d243e8e091c044 Mon Sep 17 00:00:00 2001 From: Mohamed Tarek Date: Mon, 7 Oct 2024 16:09:10 +0400 Subject: [PATCH] throw a more informative error in the default visualize method --- src/TopOpt.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TopOpt.jl b/src/TopOpt.jl index 74805feb..c747e407 100644 --- a/src/TopOpt.jl +++ b/src/TopOpt.jl @@ -50,7 +50,11 @@ export PseudoDensities include(joinpath("Utilities", "Utilities.jl")) using .Utilities -function visualize end +function visualize(arg::T; kwargs...) where {T} + return error( + "`visualize` is not defined for input type `$T`. This may be because the input to the function is incorrect or because you forgot to load `Makie` in your code. You can load `Makie` with `using Makie`. To see the available methods of `visualize` and their documentation, you can run `? visualize` in the Julia REPL.", + ) +end # Topopology optimization problem definitions include(joinpath("TopOptProblems", "TopOptProblems.jl"))