Skip to content
Browse files

add backtrace to runner.rb

  • Loading branch information...
1 parent 8845e76 commit 254990da858062c6bfb8000b72f712f68deb2120 @charliesome committed
Showing with 10 additions and 1 deletion.
  1. +10 −1 runner.rb
View
11 runner.rb
@@ -25,6 +25,15 @@
ex = catch(:exception) { vm.execute; nil }
if ex
- puts "Uncaught exception: #{Twostroke::Runtime::Types.to_string(ex).string}"
+ if ex.respond_to? :get and stack = ex.get("stack") and stack.is_a? Twostroke::Runtime::Types::String
+ puts stack.string
+ else
+ puts "Uncaught exception: #{Twostroke::Runtime::Types.to_string(ex).string}"
+ end
exit 1
+end
+
+if ARGV.include? "--post-pry"
+ require "pry"
+ pry binding
end

0 comments on commit 254990d

Please sign in to comment.
Something went wrong with that request. Please try again.