As is suggested in Pdb go to a frame in exception within exception, calling pdb.post_mortem on the __context__ of a chained exception gives a chance to debug the inner exception, and this could be nested. A minimal snippet would be
def fail():
raise Exception(1)
try:
try:
fail()
except Exception as e:
raise Exception(2) from e
except Exception as e:
import pdb
# pdb.post_mortem(e.__traceback__)
pdb.post_mortem(e.__context__.__traceback__)
But in vscode, I did not find a way to debug the inner exception from the raise Exception(2) from e line. I wonder whether this feature could be implemented.