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
Options
errOptions
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
function | string | ❌ | none | Provide which function emits this error (this is to make debugging easier) |
title | string | ✅ | none | Title of the error |
tip | string | ❌ | '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"
})