handleGenericException
fun handleGenericException(logger: Logger, keyId: KeyId? = null, algorithm: Algorithm? = null, operation: String, e: Exception): GenerateKeyResult.Failure?
Logs an ordinary exception and converts it to a key-generation failure when algorithm is supplied, otherwise returns null. Cancellation and interruption propagate unchanged.