1
0
Fork 0
mirror of synced 2024-06-28 02:50:50 +12:00

the error thrown by pouchdb is propagated if it is other than not-found

This commit is contained in:
NEOLPAR 2022-08-11 14:56:13 +01:00
parent 3f1b2d6d63
commit e24e672559

View file

@ -24,8 +24,10 @@ exports.getView = async viewName => {
const viewDoc = await db.get(generateMemoryViewID(viewName))
return viewDoc.view
} catch (err) {
// if PouchDB doesn't found the view it will fall here
return null
// Return null when PouchDB doesn't found the view
if (err.status === 404) return null
throw err
}
}
}