Skip to content

Commit

Permalink
Fix error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLin0991 committed Jul 27, 2023
1 parent af92473 commit 6afbb06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ describe('fetchHealthPlanPackage rates-db-refactor flag on tests', () => {
const resultErr = result.errors[0]

expect(resultErr?.message).toBe(
`Issue finding a package with id ${input.pkgID}. Message: An operation failed because it depends on one or more records that were required but not found.`
`Issue finding a contract with history with id ${input.pkgID}. Message: An operation failed because it depends on one or more records that were required but not found.`
)
expect(resultErr?.extensions?.code).toBe('NOT_FOUND')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function fetchHealthPlanPackageResolver(
)

if (isStoreError(contractWithHistory)) {
const errMessage = `Issue finding a package with id ${input.pkgID}. Message: ${contractWithHistory.message}`
const errMessage = `Issue finding a contract with history with id ${input.pkgID}. Message: ${contractWithHistory.message}`
logError('fetchHealthPlanPackage', errMessage)
setErrorAttributesOnActiveSpan(errMessage, span)

Expand All @@ -59,7 +59,7 @@ export function fetchHealthPlanPackageResolver(
}

if (contractWithHistory instanceof Error) {
const errMessage = `Issue finding a package with id ${input.pkgID}. Message: ${contractWithHistory.message}`
const errMessage = `Issue finding a contract with history with id ${input.pkgID}. Message: ${contractWithHistory.message}`
logError('fetchHealthPlanPackage', errMessage)
setErrorAttributesOnActiveSpan(errMessage, span)
throw new GraphQLError(errMessage, {
Expand All @@ -74,7 +74,7 @@ export function fetchHealthPlanPackageResolver(
const draftRevision = await store.findDraftContract(input.pkgID)
if (draftRevision instanceof Error) {
// If draft returns undefined we error because a draft submission should always have a draft revision.
const errMessage = `Issue finding a package with id ${input.pkgID}. Message: ${draftRevision.message}`
const errMessage = `Issue finding a draft contract with id ${input.pkgID}. Message: ${draftRevision.message}`
logError('fetchHealthPlanPackage', errMessage)
setErrorAttributesOnActiveSpan(errMessage, span)
throw new GraphQLError(errMessage, {
Expand All @@ -86,7 +86,7 @@ export function fetchHealthPlanPackageResolver(
}

if (draftRevision === undefined) {
const errMessage = `Issue finding a package with id ${input.pkgID}. Message: Result was undefined.`
const errMessage = `Issue finding a draft contract with id ${input.pkgID}. Message: Result was undefined.`
logError('fetchHealthPlanPackage', errMessage)
setErrorAttributesOnActiveSpan(errMessage, span)
throw new GraphQLError(errMessage, {
Expand Down

0 comments on commit 6afbb06

Please sign in to comment.