Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created October 24, 2011 22:51
Show Gist options
  • Save fowlmouth/1310617 to your computer and use it in GitHub Desktop.
Save fowlmouth/1310617 to your computer and use it in GitHub Desktop.
rescue
puts "\n\e[31m#{$!.class}\e[0m: #{$!.message}"
puts $!.backtrace.map { |z|
z = z.split ':'
z[0] = z[0].split('/')
z[0] = z[0][-[z[0].size, 5].min..-1]
z[0][-1] = "\e[35m#{z[0][-1]}\e[0m"
z[1] = "\e[33m#{z[1]}\e[0m"
"#{z[0].join('/')}:#{z[1]}:#{z[2]}"
}.join("\n")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment