1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Move Pry::DEFAULT_EXCEPTION_WHITELIST to Config

This commit is contained in:
Kyrylo Silin 2019-03-10 01:53:00 +02:00
parent 9b797be9ed
commit 98a2579a17
2 changed files with 4 additions and 15 deletions

View file

@ -45,7 +45,10 @@ class Pry
end end
end, end,
unrescued_exceptions: Pry::DEFAULT_UNRESCUED_EXCEPTIONS, unrescued_exceptions: [
::SystemExit, ::SignalException, Pry::TooSafeException
],
exception_whitelist: Pry.lazy do exception_whitelist: Pry.lazy do
defaults.output.puts( defaults.output.puts(
'[warning] Pry.config.exception_whitelist is deprecated, ' \ '[warning] Pry.config.exception_whitelist is deprecated, ' \

View file

@ -57,20 +57,6 @@ class Pry
end end
end end
# Don't catch these exceptions
DEFAULT_UNRESCUED_EXCEPTIONS = [SystemExit,
SignalException,
Pry::TooSafeException].freeze
DEFAULT_EXCEPTION_WHITELIST = DEFAULT_UNRESCUED_EXCEPTIONS
if Object.respond_to?(:deprecate_constant)
deprecate_constant :DEFAULT_EXCEPTION_WHITELIST
else
warn(
'DEFAULT_EXCEPTION_WHITELIST is deprecated and will be removed in a ' \
'future version of Pry. Please use DEFAULT_UNRESCUED_EXCEPTIONS instead.'
)
end
# CommandErrors are caught by the REPL loop and displayed to the user. They # CommandErrors are caught by the REPL loop and displayed to the user. They
# indicate an exceptional condition that's fatal to the current command. # indicate an exceptional condition that's fatal to the current command.
class CommandError < StandardError; end class CommandError < StandardError; end