Skip to content

Commit

Permalink
feat: add error message for manifest and domainMetadata
Browse files Browse the repository at this point in the history
Signed-off-by: Jeroen Branje <[email protected]>
  • Loading branch information
jeroenbranje committed Dec 15, 2024
1 parent 6fce15e commit 8a6ce55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apps/envited.ascs.digital/common/constants/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const ERRORS = {
ASSETS_NOT_FOUND: 'Assets not found',
ASSET_INVALID: 'Asset validation failed',
ASSET_FILE_NOT_FOUND: 'No valid metadata.json found',
DOMAIN_METADATA_INVALID: 'domainMetadata.json validation failed',
MANIFEST_INVALID: 'manifest.json validation failed',
FILES_NOT_FOUND: 'File(s) not found',
README_FILE_NOT_FOUND: 'README.md file not found',
NOT_ALLOWED_TO_DELETE_ASSET: 'Not allowed to delete asset',
Expand Down
4 changes: 2 additions & 2 deletions apps/envited.ascs.digital/common/validator/shacl/shacl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ export const _validateShaclFile =
const { conforms: domainMetadataConforms, data: domainMetadata } = await validateDomainMetadata(file, manifest)

if (!manifestConforms) {
return { isValid: false, data: {}, error: ERRORS.ASSET_INVALID }
return { isValid: false, data: {}, error: ERRORS.MANIFEST_INVALID }
}

if (!domainMetadataConforms) {
return { isValid: false, data: {}, error: ERRORS.ASSET_INVALID }
return { isValid: false, data: {}, error: ERRORS.DOMAIN_METADATA_INVALID }
}

return { isValid: true, data: { manifest, domainMetadata } }
Expand Down

0 comments on commit 8a6ce55

Please sign in to comment.