lib/wunderbar/script.rb in wunderbar-0.20.0 vs lib/wunderbar/script.rb in wunderbar-0.20.1

- old
+ new

@@ -61,11 +61,11 @@ location = exception.diagnostic.location output = "// Syntax Error: line #{location.line}, " + "column: #{location.column}\n#{exception}\n" rescue ::Exception => exception headers['status'] = "500 Internal Server Error" - output = "// Internal Server Error\n#{exception}\n" + output = "// Internal Server Error: #{exception}\n" exception.backtrace.each do |frame| next if CALLERS_TO_IGNORE.any? {|re| frame =~ re} output += " #{frame}\n" end end @@ -84,18 +84,19 @@ begin Ruby2JS.convert(data, ivars: locals) rescue Parser::SyntaxError => exception scope.response.status = 500 location = exception.diagnostic.location - "// Syntax Error: line #{location.line}, column: #{location.column}" + + "Syntax Error: line #{location.line}, column: #{location.column}" + "\n#{exception}\n" rescue Exception => exception scope.response.status = 500 - output = "// Internal Server Error\n#{exception}\n" + output = "Internal Server Error: #{exception}\n" exception.backtrace.each do |frame| next if CALLERS_TO_IGNORE.any? {|re| frame =~ re} output += " #{frame}\n" end + output end end end register Js if respond_to? :register