Email out of Rescue

22 views
Skip to first unread message

RVic

unread,
Dec 10, 2013, 8:32:33 AM12/10/13
to rubyonra...@googlegroups.com
I'm trying to set up a means to automatically send an email from certain parts of troubled code, that is, very often, code that might appear in the Rescue predicate of a begin.....rescue, so as to track down issues remotely.

Surely there must be a gem for such? If not, how might one construct something like this in code? TIA, RVic

Jordon Bedwell

unread,
Dec 10, 2013, 8:37:00 AM12/10/13
to rubyonra...@googlegroups.com
E-Mail poses a security risk and information leak issue, perhaps try
using a service that offers SSL and make sure to strip information as
it goes into it. There is HoneyBadger (I don't remember them offering
a free service) and Airbrake (they do offer a limited free account.)
There is also bugsnag but I haven't really played with them even
though for some reason they keep emailing me.

Joel Pearson

unread,
Dec 10, 2013, 8:40:37 AM12/10/13
to rubyonra...@googlegroups.com
I have a file on Github which sends an email on rescuing an error:
https://github.com/VirtuosoJoel/Toolkit/blob/master/AutoReport.rb

The method I used to send an email is the "mail" gem, and its usage is
demonstrated around line 556 in this file:
https://github.com/VirtuosoJoel/Toolkit/blob/master/MechReporter.rb

--
Posted via http://www.ruby-forum.com/.

jsnark

unread,
Dec 10, 2013, 9:29:18 AM12/10/13
to rubyonra...@googlegroups.com

tamouse pontiki

unread,
Dec 10, 2013, 9:59:23 AM12/10/13
to rubyonra...@googlegroups.com
Datadog is another option, they have a free limited level: 5 hosts, 1 day retention.

 

RVic

unread,
Dec 10, 2013, 10:43:06 AM12/10/13
to rubyonra...@googlegroups.com
Thank you all for your replies! This is very helpful.

RVic

Matt Jones

unread,
Dec 11, 2013, 9:53:01 AM12/11/13
to rubyonra...@googlegroups.com


On Tuesday, 10 December 2013 08:32:33 UTC-5, RVic wrote:
I'm trying to set up a means to automatically send an email from certain parts of troubled code, that is, very often, code that might appear in the Rescue predicate of a begin.....rescue, so as to track down issues remotely.

Surely there must be a gem for such? If not, how might one construct something like this in code? TIA, RVic

The hosted services are a good first pick - if you need something like them but can't (for security or political reasons) use a third-party service, I'd recommend trying out Errbit:


Direct-to-email stuff (like the old exception_notification plugin) is usually sub-optimal: you'll wind up getting a lot of repeated emails if your site sees reasonable traffic, making it hard to pick out *unique* errors. The services / tools above all can send emails, but they default to only notifying you about "new" errors.

--Matt Jones 
Reply all
Reply to author
Forward
0 new messages