additional exception checking in storage-read

This commit is contained in:
Peter Svensson
2019-07-15 11:34:57 +02:00
parent f8fc2a32d7
commit ca92bc0617
2 changed files with 19 additions and 13 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-firebase-admin", "name": "node-red-contrib-firebase-admin",
"version": "1.1.4", "version": "1.1.5",
"description": "A node-red module that wraps the server-side admin SDK of firebase, firestore, et.c.", "description": "A node-red module that wraps the server-side admin SDK of firebase, firestore, et.c.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -45,7 +45,8 @@ module.exports = function(RED) {
})(_file) })(_file)
}) })
} else { } else {
console.log('reading single file from path '+path) console.log('* reading single file from path '+path)
try{
this.storage this.storage
.bucket(bucket) .bucket(bucket)
.file(path).download().then((file)=>{ .file(path).download().then((file)=>{
@ -58,6 +59,11 @@ module.exports = function(RED) {
msg.payload = undefined msg.payload = undefined
node.send(msg) node.send(msg)
}) })
} catch(ex){
console.log('storage-read caught exception: '+ex)
node.send(msg)
}
} }
} }
}.bind(this)); }.bind(this));