I have the same exception when I created firebase-function
usingfirebase-tool
const ref = admin.database().ref("path/to/database/object");
ref.once("value").catch(error =>{
response.send( error() );
}).then( snapshot =>{
response.send( snapshot.val );
})
This code is not compiled and return
ERROR: /src/index.ts[22, 5]: Promises must be handled appropriately
I changed places catch
and then
.
ref.once(...).then(...).catch(...)
This code works, sorry, but I have no explanation
It is so surprising that the application returns some error without a block, catch
even in accordance with firebase doc
without mentioning what is required catch
.
source
share