Skip to content

Commit bad1c46

Browse files
authored
improve error message when julia repl is not loaded (#129)
* improve error message when julia repl is not loaded * add an error when not a LineEditREPL
1 parent 79dc17b commit bad1c46

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/repl.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11

22
promptname(level, name) = "$level|$name> "
3-
function RunDebugger(frame, repl = Base.active_repl, terminal = Base.active_repl.t; initial_continue=false)
3+
function RunDebugger(frame, repl = nothing, terminal = nothing; initial_continue=false)
4+
if repl === nothing
5+
if !isdefined(Base, :active_repl)
6+
error("Debugger.jl needs to be run in a Julia REPL")
7+
end
8+
repl = Base.active_repl
9+
end
10+
if !isa(repl, REPL.LineEditREPL)
11+
error("Debugger.jl requires a LineEditREPL type of REPL")
12+
end
13+
14+
if terminal === nothing
15+
terminal = Base.active_repl.t
16+
end
417
state = DebuggerState(; frame=frame, repl=repl, terminal=terminal)
518

619
# Setup debug panel

0 commit comments

Comments
 (0)