Use Error object in pgp wrapper