Skip to content

Commit

Permalink
improve error handling (#297)
Browse files Browse the repository at this point in the history
* improve error handling

* Update .nycrc.json
  • Loading branch information
slavik-lvovsky authored Jun 6, 2020
1 parent 4018ef2 commit 5423c0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/.nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"check-coverage": true,
"branches": 79.8,
"lines": 86,
"functions": 81,
"statements": 86
"functions": 80.3,
"statements": 85.6
}
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yeoman-ui",
"version": "1.0.11",
"version": "1.0.12",
"displayName": "Application Wizard",
"publisher": "SAPOS",
"author": {
Expand Down
6 changes: 6 additions & 0 deletions backend/src/yeomanui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ export class YeomanUI {
this.promptCount = 0;
this.gen = (gen as Generator);
this.gen.destinationRoot(targetFolder);

env.on("error", error => {
env.removeAllListeners("error");
this.onGeneratorFailure(generatorName, error);
env.emit("error", error);
});
// we cannot use new async method, "await this.gen.run()", because generators based on older versions
// (for example: 2.0.5) of "yeoman-generator" do not support it
this.gen.run(async (error) => {
Expand Down

0 comments on commit 5423c0f

Please sign in to comment.