Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 52e1316

Browse files
authored
Catch errors in GET /identity endpoint
1 parent df3173d commit 52e1316

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/lib/orbitdb-api.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,12 @@ class OrbitdbAPI extends Express {
202202
}
203203

204204
this.get('/identity', (req, res, next) => {
205-
const identity = dbm.identity()
206-
207-
return res.json(identity)
205+
try {
206+
const identity = dbm.identity()
207+
return res.json(identity)
208+
} catch(err) {
209+
next(err)
210+
}
208211
});
209212

210213
var db_put_write_public_key = asyncMiddleware( async (req, res, next) => {

0 commit comments

Comments
 (0)