SplitScript.js
discordnpmgithub
  • 👋Welcome to SplitScript.js
  • 🍎core
    • root
    • cli
    • EventEmitter
    • Handling Errors
  • 🤖discord
    • getting started
    • create your first project
    • automod
    • bans
    • channels
    • commands
    • emojis
    • followups
    • types
  • 🌐https
    • usage
    • changelog
  • 🔗Links
    • Discord
    • NPM
    • GitHub
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. core

Handling Errors

When running SplitScript, an unhandled error will crash your process

We proved a handleError function that will catch all errors from your listeners

import { handleError } from '@splitscript.js/core'

handleError((data, error) => {
        console.log("There was an error: ", error)
})
// You can add multiple error handlers
handleError((data, error) => {
        console.log("There was an error: ", error)
})

Make sure you put the handleError function at the start of your code

PreviousEventEmitterNextgetting started

Last updated 1 year ago

Was this helpful?

🍎