mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Dont' infinite loop on errors in readline.
Instead try to show a useful error message.
This commit is contained in:
parent
e94d17370d
commit
afe900721b
1 changed files with 10 additions and 0 deletions
|
@ -522,6 +522,16 @@ class Pry
|
|||
self.input = input_stack.pop
|
||||
end
|
||||
retry
|
||||
# We want to catch exceptions that happen in readline and abort completely,
|
||||
# otherwise we'll likely go round and round the repl-loop and fail every time.
|
||||
rescue RescuableException => e
|
||||
puts "Error: #{e.message}"
|
||||
puts "FATAL: Pry failed to get user input using `#{input.inspect}`."
|
||||
puts "To fix this you may be able to pass input and output file descriptors to pry directly. e.g."
|
||||
puts " Pry.config.input = STDIN"
|
||||
puts " Pry.config.output = STDOUT"
|
||||
puts " binding.pry
|
||||
throw(:breakout)
|
||||
end
|
||||
end
|
||||
private :handle_read_errors
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue