Error logging for gsheet fetch

This commit is contained in:
efarooqui
2021-04-14 18:07:48 -07:00
parent 6ab37ccb70
commit 8bd5f38ac4
3 changed files with 6 additions and 3 deletions

View File

@@ -30,9 +30,10 @@ export default ({ config, controller }) => {
success: msg success: msg
}) })
) )
.catch(err => .catch(err => {
res.status(404) res.status(404)
.send({ error: err.message, err }) .send({ error: err.message, err })
}
) )
}) })

View File

@@ -217,7 +217,10 @@ class GsheetFetcher extends Fetcher {
}) })
.then(this._buildBlueprintsAsync()) .then(this._buildBlueprintsAsync())
.then(() => true) .then(() => true)
.catch(() => false) .catch((err) => {
console.log(`Error fetching gsheets: ${err.message}`)
return false
})
} }
} }

View File

@@ -19,7 +19,6 @@ class StoreJson {
save (url, data) { save (url, data) {
const parts = url.split('/') const parts = url.split('/')
return fs.writeFile( return fs.writeFile(
`${STORAGE_DIRNAME}/${parts[0]}__${parts[1]}__${parts[2]}.json`, `${STORAGE_DIRNAME}/${parts[0]}__${parts[1]}__${parts[2]}.json`,
JSON.stringify(data) JSON.stringify(data)