Update string.rb

Added rescue and logger for stack level error