Skip to content

Instantly share code, notes, and snippets.

@suhanlee
Created October 17, 2017 17:04
Show Gist options
  • Save suhanlee/a382b2f1f99758fe2974b5ffe77743a0 to your computer and use it in GitHub Desktop.
Save suhanlee/a382b2f1f99758fe2974b5ffe77743a0 to your computer and use it in GitHub Desktop.
Pry.config.exception_handler = proc do |output, exception, _|
if UserError === exception && SyntaxError === exception
output.puts "SyntaxError: #{exception.message.sub(/.*syntax error, */m, '')}
else
output.puts "#{exception.class}: #{exception.message}"
output.puts "from #{exception.backtrace}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment