Skip to main content

emitError

Produce error messages just like Simply DJS does !

extends Error

WARNING

This may cause your entire project to stop as it emits an error and not logging in the console.

Implementation

simplydjs.emitError({
title: "Test", // required
// options (optional)
})

Types

simplydjs.emitError(options: errOptions)

Options

errOptions

ParameterTypeRequiredDefaultDescription
functionstringnoneProvide which function emits this error (this is to make debugging easier)
titlestringnoneTitle of the error
tipstring'Get ya help here -> [https://discord.gg/3JzDV9T5Fn]'Provide a tip. So you can have clear view of why the error occurs
export type errOptions = {
function?: string;
title?: string;
tip?: string;
};

Example

error.js
const simplydjs = require('simply-djs')

simplydjs.emitError({
function: "test.js",
title: "Testing error",
tip: "Make errors with simply-djs"
})