From 2932c08ef8cfbb49460dfb9516825ddd9935cce2 Mon Sep 17 00:00:00 2001 From: Nils K <24257556+septatrix@users.noreply.github.com> Date: Tue, 19 Sep 2023 20:05:49 +0200 Subject: [PATCH] Register error handler using hook instead of hookOnce See https://github.com/unjs/nitro/issues/1736#issuecomment-1724519928 --- docs/content/1.guide/7.plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/1.guide/7.plugins.md b/docs/content/1.guide/7.plugins.md index 9a33c7ab9f..4349a9225a 100644 --- a/docs/content/1.guide/7.plugins.md +++ b/docs/content/1.guide/7.plugins.md @@ -77,7 +77,7 @@ You can use plugins to capture all application errors. ```ts export default defineNitroPlugin((nitro) => { - nitro.hooks.hookOnce("error", async (error, { event }) => { + nitro.hooks.hook("error", async (error, { event }) => { console.error(`${event.path} Application error:`, error) }); })