From c29f1a11fced1a962a9ea359582dc9a3f6527076 Mon Sep 17 00:00:00 2001 From: chasers Date: Wed, 30 Jun 2021 15:54:16 -0700 Subject: [PATCH] Error cleanup --- pages/api/error-pino-logflare.js | 8 +++----- pages/api/error-pino.js | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pages/api/error-pino-logflare.js b/pages/api/error-pino-logflare.js index 7316cd0..78fb995 100644 --- a/pages/api/error-pino-logflare.js +++ b/pages/api/error-pino-logflare.js @@ -2,13 +2,11 @@ import logger from '../../logger/logger' export default function handler(req, res) { - // Lets log an error with console here. + // Lets log an error with pino-logflare here. try { - throw new Error('Whoops!') + throw new Error('Whoops! Error with pino-logflare.') } catch (e) { - const onlyPino = require('pino')() - - onlyPino.error(e) + logger.error(e) } res.status(200).json({ error: 'true' }) diff --git a/pages/api/error-pino.js b/pages/api/error-pino.js index 7316cd0..1973358 100644 --- a/pages/api/error-pino.js +++ b/pages/api/error-pino.js @@ -2,9 +2,9 @@ import logger from '../../logger/logger' export default function handler(req, res) { - // Lets log an error with console here. + // Lets log an error with pino here. try { - throw new Error('Whoops!') + throw new Error('Whoops! Error with pino.') } catch (e) { const onlyPino = require('pino')()