[ruby/error_highlight] Enable ErrorHighlight for TypeError/ArgumentError only after Ruby 3.2
... because changing TypeError#message and ArgumentError#message is highly incompatible. https://github.com/ruby/error_highlight/commit/39aa897c7a
This commit is contained in:
parent
96d29dff66
commit
8bfd4dd4e1
@ -37,6 +37,11 @@ module ErrorHighlight
|
|||||||
end
|
end
|
||||||
|
|
||||||
NameError.prepend(CoreExt)
|
NameError.prepend(CoreExt)
|
||||||
|
|
||||||
|
if Exception.method_defined?(:detailed_message)
|
||||||
|
# ErrorHighlight is enabled for TypeError and ArgumentError only when Exception#detailed_message is available.
|
||||||
|
# This is because changing ArgumentError#message is highly incompatible.
|
||||||
TypeError.prepend(CoreExt)
|
TypeError.prepend(CoreExt)
|
||||||
ArgumentError.prepend(CoreExt)
|
ArgumentError.prepend(CoreExt)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user