Skip to content

Commit

Permalink
fix: Typing hook arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
luksak committed Aug 14, 2024
1 parent 43be486 commit b5d22d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import newrelic from 'newrelic'
import type { H3Event } from 'h3'

export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('request', (event) => {
nitroApp.hooks.hook('request', (event: H3Event) => {
newrelic.setTransactionName(event.path)
})
nitroApp.hooks.hook('error', (error, context) => {
nitroApp.hooks.hook('error', (error: Error) => {
newrelic.noticeError(error)
})
})

0 comments on commit b5d22d3

Please sign in to comment.