Skip to content

Commit

Permalink
fix: πŸ› handle promise rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
shufo committed Oct 31, 2020
1 parent d17db5b commit 5297333
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ function activate(context) {
wrapAttributes: extConfig.wrapAttributes
};

return new Promise((resolve) => {
return new Promise((resolve, reject) => {
return new Formatter(options)
.formatContent(originalText)
.then((text) => {
resolve([new vscode.TextEdit(range, text)]);
})
.then(undefined, err => {
reject(err);
});
});
},
Expand Down

0 comments on commit 5297333

Please sign in to comment.