[packagedb-cli: 5/7] Catch exceptions as to be py3 compatible