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:
parent
9b797be9ed
commit
98a2579a17
2 changed files with 4 additions and 15 deletions
|
@ -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, ' \
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue