[PATCH 2 of 2] worker: catch all exceptions, try to exit usefully/safely

Augie Fackler raf at durin42.com
Fri Apr 12 15:40:42 CDT 2013


Both LG, queued


On Thu, Apr 11, 2013 at 01:30:49PM -0700, Bryan O'Sullivan wrote:
> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1365712231 25200
> #      Thu Apr 11 13:30:31 2013 -0700
> # Node ID dbcff0d4ff471fea5f2aae5a38aae36e367641b1
> # Parent  3d2ead77daf3f2ec8a49fa4baf0cfb69e20fbaa6
> worker: catch all exceptions, try to exit usefully/safely
>
> diff --git a/mercurial/worker.py b/mercurial/worker.py
> --- a/mercurial/worker.py
> +++ b/mercurial/worker.py
> @@ -89,6 +89,11 @@
>                  os._exit(0)
>              except KeyboardInterrupt:
>                  os._exit(255)
> +            except: # re-raises (close enough for debugging anyway)
> +                try:
> +                    ui.traceback()
> +                finally:
> +                    os._exit(255)
>          pids.append(pid)
>      pids.reverse()
>      os.close(wfd)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list