reopen 361780 reassign 361780 liblog4r-ruby1.8 tags 361780 + upstream thanks
Coin,
akira yamada <[EMAIL PROTECTED]> writes:
> I think that Net::SMTP does not have a such bug.
> In the situation Net::SMTP raises Net::SMTPServerBusy.
> I tested as follows:
>
> $ ruby -r net/smtp -e '
> smtp = Net::SMTP.start("smtp.example.com")
> sleep 60*6
> smtp.sendmail("... message header & body ...", "[EMAIL PROTECTED]",
> ["[EMAIL PROTECTED]"])
> puts "OK"'
> /usr/lib/ruby/1.8/net/smtp.rb:680:in `check_response': 421 smtp.example.com
> Error: timeout exceeded (Net::SMTPServerBusy)
> from /usr/lib/ruby/1.8/net/smtp.rb:653:in `getok'
> from /usr/lib/ruby/1.8/net/smtp.rb:631:in `mailfrom'
> from /usr/lib/ruby/1.8/net/smtp.rb:544:in `send0'
> from /usr/lib/ruby/1.8/net/smtp.rb:472:in `sendmail'
> from -e:4
>
> But Log4r::EmailOutputter#send_mail drops it at line 105-110:
>
> begin @smtp.sendmail(rfc822msg, @from, @to)
> rescue Exception => e
> Logger.log_internal(-2) {
> "EmailOutputter '[EMAIL PROTECTED]' couldn't send email!"
> }
> Logger.log_internal {e}
> self.level = OFF
> ensure @buff.clear
> end
>
> "rescue Exception" captures all exceptions which are raised by
> "@smtp.sendmail"
> and the block does not raise any exceptions.
Yes, you're perfectly right.
> If it is not a specification of Log4r::EmailOutputter,
> "raise e" is needed in the rescue-block.
Why then do you close this bug ?
Log4r is designed to allow catching internal events by creating a logger
named 'log4r' with an appropriate outputter. But there is no mechanism
to catch errors (parsing internal logs would be ugly). Then, exceptions
should be used, and this is a Log4r bug.
Reopening and reassigning.
Btw, Net::SMTPServerBusy is totaly inadequate name,
Net::SMTPServerTimeout would be much better.
--
Marc Dequènes (Duck)
pgpkjwcKya3vx.pgp
Description: PGP signature

