'How to replace default try/except block to customized try/except block in VSCode for Python

When using VSCode for Python the try/except autocomplete comes with following:

try:
    print(0)
except print(0):
    pass

I want to replace default to something like following for autocomplete so I don't need to keep changing the except block:

try:
    print(0)
except (Exception) as e:
    self.logger.exception("Error Occured: {0}".format(e))

This will save sometime.

I tried to look at JSON setting but I could not find for try/except block (or maybe I was not looking at the right place).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source