As discussed on IRC, this new exception handling is untested. To avoid
things breaking, and to avoid people getting tempted into refactoring
the outer exception handling into using self._doOops(), we need two
tests; one where job.notifyUserError() errors out, and one where
job.notifyOops() errors out.
Since it's EOD for you now, I'd be willing to let this branch land
without tests (since it won't break anything not already broken), so
that you can QA it more easily on Monday. Given that you promise to
write the tests on Monday, of course.
On Fri, Apr 30, 2010 at 05:26:29AM -0000, Tim Penhey wrote: services/ job/runner. py' services/ job/runner. py 2010-04-06 03:37:16 +0000 services/ job/runner. py 2010-04-30 05:22:33 +0000
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -181,13 +184,24 @@ utility. oopsMessage( getOopsVars( ))): debug(' Running %r', job) error_types, e: rror(e) debug(' Running %r', job) error_types, e: rror(e) exception( e) utility. raising( info) utility. getLastOopsRepo rt()
> with self.error_
> dict(job.
> try:
> - self.logger.
> - self.runJob(job)
> - except job.user_
> - job.notifyUserE
> - except Exception:
> + try:
> + self.logger.
> + self.runJob(job)
> + except job.user_
> + job.notifyUserE
> + except Exception:
> + info = sys.exc_info()
> + return self._doOops(job, info)
> + except Exception, e:
> + # This only happens if sending attempting to notify users
> + # about errors fails for some reason (like a misconfigured
> + # email server).
> + self.logger.
> info = sys.exc_info()
> - return self._doOops(job, info)
> + self.error_
> + oops = self.error_
> + # Returning the oops says something went wrong.
> + return oops
As discussed on IRC, this new exception handling is untested. To avoid rror() errors out, and one where
things breaking, and to avoid people getting tempted into refactoring
the outer exception handling into using self._doOops(), we need two
tests; one where job.notifyUserE
job.notifyOops() errors out.
Since it's EOD for you now, I'd be willing to let this branch land
without tests (since it won't break anything not already broken), so
that you can QA it more easily on Monday. Given that you promise to
write the tests on Monday, of course.
vote approve
-- /launchpad. net/~bjornt
Björn Tillenius | https:/