Skip to content

Commit

Permalink
- catch errors in cropsList query
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispahm committed Jul 31, 2020
1 parent 9cf9f16 commit c425f35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cropList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const async = require('async')

module.exports = {
async getCrops(farmingType) {
return new Promise(resolve => {
return new Promise((resolve,reject) => {
osmosis
.get('https://daten.ktbl.de/vrpflanze/home.action')
.find('div.aktionskastenUnten > a')
Expand All @@ -23,11 +23,12 @@ module.exports = {
})
resolve(res)
})
.error(reject)
})
},

async getSystemsForCrop(farmingType,crop) {
return new Promise(resolve => {
return new Promise((resolve,reject) => {
osmosis
.get('https://daten.ktbl.de/vrpflanze/home.action')
.find('div.aktionskastenUnten > a')
Expand All @@ -53,6 +54,7 @@ module.exports = {
})
resolve(res)
})
.error(reject)
})
},

Expand Down

0 comments on commit c425f35

Please sign in to comment.