diff --git a/packages/bitcore-node/src/utils/auth.ts b/packages/bitcore-node/src/utils/auth.ts index 251f94b181c..5466387fd7d 100644 --- a/packages/bitcore-node/src/utils/auth.ts +++ b/packages/bitcore-node/src/utils/auth.ts @@ -68,7 +68,8 @@ const authenticateMiddleware: RequestHandler = async (req: Request, res: Respons return res.status(401).send('Authentication failed'); } return next(); - } catch (e) { + } catch (e: any) { + logger.error('Unexpected error authenticating request: %o', e?.stack || e?.message || e); return res.status(401).send('Authentication failed'); } };