Skip to content

Commit

Permalink
feat: catch error if date can not be parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Jul 12, 2023
1 parent fb9b70d commit ab24e45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/getMetaData.js
Expand Up @@ -52,7 +52,12 @@ export function getMetaData(info, meta) {
}

if (meta.DATE) {
metadata.date = new Date(meta.DATE * 1000).toISOString();
try {
metadata.date = new Date(meta.DATE * 1000).toISOString();
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
}
}
return metadata;
}
Expand Down

0 comments on commit ab24e45

Please sign in to comment.