Skip to content

Commit

Permalink
Merge pull request #65 from olafnorge/bug/fix-missing-try-catch
Browse files Browse the repository at this point in the history
Added try/catch around promise
  • Loading branch information
eouia authored Mar 31, 2020
2 parents a9549cd + 65d7f8b commit 9ad639a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ module.exports = NodeHelper.create({
getAlbums: function() {
return new Promise((resolve)=>{
const step = async ()=> {
var r = await GPhotos.getAlbums()
resolve(r)
try {
var r = await GPhotos.getAlbums()
resolve(r)
} catch (err) {
this.log(err.toString())
console.log(err)
}
}
step()
})
Expand Down

0 comments on commit 9ad639a

Please sign in to comment.