<commit_before>package etcd_helpers

import (
	"github.com/cloudfoundry-incubator/bbs/db/etcd"
	"github.com/cloudfoundry-incubator/bbs/models"
	"github.com/cloudfoundry/storeadapter"

	. "github.com/onsi/gomega"
)

func (t *ETCDHelper) GetInstanceActualLRP(lrpKey *models.ActualLRPKey) (*models.ActualLRP, error) {
	resp, err := t.etcdClient.Get(etcd.ActualLRPSchemaPath(lrpKey.ProcessGuid, lrpKey.Index), false, false)
	if err == storeadapter.ErrorKeyNotFound {
		return &models.ActualLRP{}, models.ErrResourceNotFound
	}
	Expect(err).NotTo(HaveOccurred())
<commit_msg>fix etcd helper err check<commit_after>package etcd_helpers

import (
	"github.com/cloudfoundry-incubator/bbs/db/etcd"
	"github.com/cloudfoundry-incubator/bbs/models"
	etcdclient "github.com/coreos/go-etcd/etcd"

	. "github.com/onsi/gomega"
)

func (t *ETCDHelper) GetInstanceActualLRP(lrpKey *models.ActualLRPKey) (*models.ActualLRP, error) {
	resp, err := t.etcdClient.Get(etcd.ActualLRPSchemaPath(lrpKey.ProcessGuid, lrpKey.Index), false, false)
	if etcdErr, ok := err.(*etcdclient.EtcdError); ok && etcdErr.ErrorCode == etcd.ETCDErrKeyNotFound {
		return &models.ActualLRP{}, models.ErrResourceNotFound
	}

	Expect(err).NotTo(HaveOccurred())

{'fraction_non_alphanumeric': 0.13815789473684212, 'fraction_numerical': 0.0, 'mean_word_length': 6.075581395348837, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1997640', 'n_tokens_mistral': 481, 'n_tokens_neox': 475, 'n_words': 63}