开发者

How do I use async_sinatra with hoptoad exception notifier?

开发者 https://www.devze.com 2023-02-06 16:32 出处:网络
It seems like async_sinatra swallows the exception before it 开发者_如何转开发can be passed to hoptoad.

It seems like async_sinatra swallows the exception before it 开发者_如何转开发can be passed to hoptoad.

Thanks!


Async_sinatra provides the handle_exception! hook, which you ought to be able to use to handle the exception. Declare a function in your main Sinatra class:

def handle_exception!(boom)
  # Log, print, send to Hoptoad/Airbrake etc.
end

Source code at:

https://github.com/raggi/async_sinatra/blob/master/lib/sinatra/async.rb#L129

0

精彩评论

暂无评论...
验证码 换一张
取 消