Skip to content

Commit

Permalink
REMOVE invalid semver version tantrum
Browse files Browse the repository at this point in the history
catch Error to keep stacktrace
  • Loading branch information
haraldox committed Feb 28, 2018
1 parent 2c7f650 commit dd9f447
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/models/Recipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dd9f447

Please sign in to comment.