Take a Kleopatra group of OpenPGP Keys from which one is expired and try to encrypt for it:
Selection works with an appropriate feedback, but then the user get an unexpected error message:
If something fails, it should be the encryption, not the Signature....
GpgME seems to "know" the real problem, though:
[7420] org.kde.pim.kleopatra: Kleo::Crypto::SignEncryptTask(0x8f4e648) slotResult job: QGpgME::QGpgMESignEncryptJob(0x62624e0) signing result: "GpgME::SigningResult(\n error: GpgME::Error(117440565 (Unbrauchbarer öffentlicher Schlüssel))\n createdSignatures:\n invalidSigningKeys:\nGpgME::InvalidSigningKey(\n fingerprint: 1B7724C95351B75394303415C2577F23F8E93418\n reason: GpgME::Error(117440513 (Allgemeiner Fehler))\n)\n)" encryption result: "GpgME::EncryptionResult(\n error: GpgME::Error(117440565 (Unbrauchbarer öffentlicher Schlüssel))\n invalid recipients:\nGpgME::InvalidRecipient(\n fingerprint: 1B7724C95351B75394303415C2577F23F8E93418\n reason: GpgME::Error(117440729 (Alle Unterschlüssel sind abgelaufen oder widerrufen))\n)\n)"