[ruby-core:125311] [Ruby Bug#22007] Inconsistent type checking on rescue