Permalink
Browse files

REMOVE invalid semver version tantrum

catch Error to keep stacktrace
  • Loading branch information...
haraldox committed Feb 28, 2018
1 parent 2c7f650 commit dd9f447042e45259c272a336a349ab7b1a04a2b6
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/models/Recipe.js
@@ -32,8 +32,12 @@ export default class Recipe {
throw Error(`Recipe '${data.name}' requires Id`);
}
if (!semver.valid(data.version)) {
throw Error(`Version ${data.version} of recipe '${data.name}' is not a valid semver version`);
try {
if (!semver.valid(data.version)) {
throw Error(`Version ${data.version} of recipe '${data.name}' is not a valid semver version`);
}
} catch (e) {
console.warn(e.message);
}
this.id = data.id || this.id;

0 comments on commit dd9f447

Please sign in to comment.