From 3e3cc36ec8ecfe873449c6c53e5babf2383a000a Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:32:32 -0600 Subject: [PATCH] Update error-handling.mdx --- src/content/docs/v4/reference/error-handling.mdx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/content/docs/v4/reference/error-handling.mdx b/src/content/docs/v4/reference/error-handling.mdx index 9b68e2431..5722b9bc0 100644 --- a/src/content/docs/v4/reference/error-handling.mdx +++ b/src/content/docs/v4/reference/error-handling.mdx @@ -5,12 +5,17 @@ sidebar: order: 9 --- +:::tip +If you want sern to just capture errors with nothing other than a simple log as to the error, +set [handleModuleErrors](/v4/api/interfaces/wrapper/#handlemoduleerrors) to handle errors that occur within modules automatically +::: + Error handling is important in any application, especially one which has a long lifetime of running. ## Handling errors in command and event modules -To capture errors, enable the 'error' event in sern's global event manager. +To capture errors, enable the `error` event in sern's global event manager. import { FileTree } from '@astrojs/starlight/components'; @@ -50,11 +55,7 @@ export default eventModule({ If the error handler is not set, sern's behavior is to crash the application. This respects [node.js's default behavior](https://nodejs.org/api/events.html#error-events) -:::tip -enable `handleModuleErrors` to handle errors that occur within modules. - -::: :::caution