Skip to content

Commit

Permalink
Lets see what type of errors look like
Browse files Browse the repository at this point in the history
  • Loading branch information
chasers committed Jun 30, 2021
1 parent daba67f commit d1eb113
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
File renamed without changes.
15 changes: 15 additions & 0 deletions pages/api/error-pino-logflare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import logger from '../../logger/logger'

export default function handler(req, res) {

// Lets log an error with console here.
try {
throw new Error('Whoops!')
} catch (e) {
const onlyPino = require('pino')()

onlyPino.error(e)
}

res.status(200).json({ error: 'true' })
}
15 changes: 15 additions & 0 deletions pages/api/error-pino.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import logger from '../../logger/logger'

export default function handler(req, res) {

// Lets log an error with console here.
try {
throw new Error('Whoops!')
} catch (e) {
const onlyPino = require('pino')()

onlyPino.error(e)
}

res.status(200).json({ error: 'true' })
}

0 comments on commit d1eb113

Please sign in to comment.