adhearsion/adhearsion — Issue #122: Incorrect exceptions in hangup during infinite loops
Author: bklang
Created: 2012-03-05 22:21:44+00:00
State: open

The code is this:

```ruby
Adhearsion.router do
route 'default' do
answer
loop { speak "Hi there!" }
hangup
end
end
```

Then I call the app and hangup during the loop.

I've seen the following two exceptions appear. The first is sorta acceptable since it references Adhearsion::Hangup, though it says it a repetitive three times:

```
[2012-03-05 15:27:35] ERROR Adhearsion::Initializer: caused by #: Adhearsion::Hangup
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/celluloid-0.9.0/lib/celluloid.rb:162:in `abort'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-a5aad6622eab/lib/adhearsion/call.rb:165:in `write_and_await_response'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-a5aad6622eab/lib/adhearsion/call.rb:113:in `hangup'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-a5aad6622eab/lib/adhearsion/call.rb:194:in `block (2 levels) in execute_controller'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-a5aad6622eab/lib/adhearsion/foundation/exception_handler.rb:4:in `catching_standard_errors'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-a5aad6622eab/lib/adhearsion/call.rb:190:in `block in execute_controller'
```

The second time though I got a more nonsense error:

```
[2012-03-05 17:05:15] ERROR Adhearsion::Initializer: caused by #: #
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/celluloid-0.9.0/lib/celluloid.rb:162:in `abort'
/Users/bklang/src/adhearsion/lib/adhearsion/call.rb:177:in `write_and_await_response'
/Users/bklang/src/adhearsion/lib/adhearsion/call.rb:125:in `hangup'
/Users/bklang/src/adhearsion/lib/adhearsion/call.rb:213:in `block (2 levels) in execute_controller'
/Users/bklang/src/adhearsion/lib/adhearsion/foundation/exception_handler.rb:4:in `catching_standard_errors'
/Users/bklang/src/adhearsion/lib/adhearsion/call.rb:209:in `block in execute_controller'
```