FailBowl is a simple Gem which helps you find the source of that pesky stack overflow that many ORMs are so keen to send us.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install fail_bowl
To use FailBowl simply call:
stack_overflow = FailBowl.trace do # suspicious code end
Since tracing every call produces a lot of output it's usually a good idea to try and reduce the amount of code you are suspicious of as much as possible before passing it through FailBowl.
If the enclosed code does not raise a
then FailBowl will raise an exception telling you so.
Otherwise FailBowl will return a
which has been augmented with a bunch of useful methods:
#call_logprovides a text-based representation of the calls made during the trace. Returns a string, or if a file object is passed as an argument writes the contents to that instead.
#callsreturns a (large) array of tracing events in case you need more information.
#call_graphprovides a nested tree of call events to make it easy to trace execution paths.
hotlistreturns a sorted list of method calls and call counts.
FailBowl is copyright (c) 2012, Sociable Limited and licensed under the terms of the MIT license. See the LICENSE file in this distribution for details.
- James Harton, Sociable Limited firstname.lastname@example.org
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request