-
-
Save badbabykosh/1ac1c5160079c448543aeb489c420494 to your computer and use it in GitHub Desktop.
Get a trace from a 'stack too deep' error in Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$enable_tracing = false | |
#$trace_out = File.open(Rails.root + 'trace.txt', 'w') | |
set_trace_func proc { |event, file, line, id, binding, classname| | |
if $enable_tracing && event == 'call' | |
#$trace_out.puts "#{file}:#{line} #{classname}##{id}" | |
raise "crash me" if caller_locations.length > 500 | |
end | |
} | |
$enable_tracing = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment