Skip to content

Commit 52ff938

Browse files
authored
Add error hint for extension packages (#69)
This provides a hint to the user about how to fix MethodErrors.
1 parent ea51e2e commit 52ff938

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/BioStructures.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ include("download.jl")
2828
include("spatial.jl")
2929
include("bonding.jl")
3030

31+
function __init__()
32+
Base.Experimental.register_error_hint(MethodError) do io, exc, _, _
33+
if exc.f (rundssp, rundssp!, runstride, runstride!)
34+
if isempty(methods(exc.f))
35+
printstyled(io, "\nYou may need `using DSSP_jll` or `using STRIDE_jll` to load the appropriate methods."; color=:yellow)
36+
end
37+
end
38+
end
39+
end
40+
3141
@compile_workload begin
3242
let
3343
mktemp() do path, io

0 commit comments

Comments
 (0)