]> arthur.barton.de Git - bup.git/commit
chain_ex: don't opportunistically add tracebacks to context_ex
authorRob Browning <rlb@defaultvalue.org>
Sun, 31 Dec 2017 18:23:01 +0000 (12:23 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 31 Dec 2017 18:23:01 +0000 (12:23 -0600)
commitcfd397a593ce52cafdbb1af934f431dcd08fc5d2
tree506e7a46bb7e6bfbc1b2285fd68dec10f8241c30
parent3fc0272bdd8f5fb24f925b5a2323ccd0df13e243
chain_ex: don't opportunistically add tracebacks to context_ex

Don't add a traceback to the context_ex while chaining.  This could be
wrong, depending on the context, and in the common case, the traceback
more likely belonged on the result exception, not the context_ex.,
i.e.

  except ... as ex:
      raise chain_ex(ex, pending_ex)

Instead, just combine chain_ex with add_ex_tb when appropriate:

  except ... as ex:
      raise chain_ex(add_tb_ex(ex), pending_ex)

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/compat.py