fix exception catching
Merge remote-tracking branch 'kali/bug/fix-assertion-error-gnupg' into develop