Skip to content

Commit

Permalink
feat(MIG-166): throw manifest not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
abulseed committed Jan 15, 2024
1 parent 9452dec commit a13688a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/mdctl-axon-tools/__tests__/MIG-166/MIG-166.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,16 @@ describe('MIG-166', () => {
}
})
})

it('should print "mdctl.kManifestNotFound.error" in case of missing manifest file.', async() => {
let err
try {
studyTranslations.isAuthTaskTranslations({})
} catch (error) {
err = error
}

expect(err.errCode)
.to.equal('mdctl.kManifestNotFound.error')
})
})
4 changes: 4 additions & 0 deletions packages/mdctl-axon-tools/lib/StudyDataTranslations.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class StudyDataTranslations {
}
}

if (!manifestData) {
throw Fault.create('mdctl.kManifestNotFound.error', { reason: 'There is no manifest set as parameter neither found in directory' })
}

if (manifestData.authenticationTaskTranslations && !_.has(manifestData, 'i18ns')) {
throw Fault.create('mdctl.kInvalidArgument.missingI18nObjects', {
message: 'The manifest is missing "i18ns" objects',
Expand Down

0 comments on commit a13688a

Please sign in to comment.