Skip to content

Commit

Permalink
feat(app): display error for routes parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
vogloblinsky committed Nov 11, 2016
1 parent e7448e7 commit 69a52d7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/compiler/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,13 @@ export class Dependencies {
} else {
let IO = this.getRouteIO(file);
if(IO.routes) {
outputSymbols['routes'] = [...outputSymbols['routes'], ...JSON.parse(IO.routes.replace(/ /gm, ''))];
let newRoutes;
try {
newRoutes = JSON.parse(IO.routes.replace(/ /gm, ''));
} catch (e) {
logger.error('Routes parsing error, maybe a trailing comma ?');
}
outputSymbols['routes'] = [...outputSymbols['routes'], ...newRoutes];
}
}
});
Expand Down

0 comments on commit 69a52d7

Please sign in to comment.