Browse Source

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

master
NEOLPAR 4 years ago
parent
commit
e24e672559
  1. 6
      packages/server/src/api/controllers/view/utils.js

6
packages/server/src/api/controllers/view/utils.js

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

Loading…
Cancel
Save