SecureConnection.setError() refactored