Error Handling
[ERROR] Encountered error on message command "test" at path "C:\Users\cmart\Desktop\Discord Bots\Sapphire\src\commands\Developer\test.js"
Anyway of removing these error messages if the type of the error is a string? I don't want this error showing up on console when I do stuff like, for example:
6 Replies
Well first of all this exists even if you don't use it right now: https://eslint.org/docs/latest/rules/no-throw-literal
Secondly, no because literal errors are still error classes. What you can do however is
Then throw a
new LiteralError
and detect it with if (error instanceof LiteralError)
no-throw-literal - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Alternatively, you can use
UserError
from Sapphireis there any documentation for it
alright ty