17 lines
460 B
JavaScript
17 lines
460 B
JavaScript
// TODO: Improve how messages are stringified
|
|
const ChatMessage = require('prismarine-chat')('1.20.1')
|
|
const stringify = message => new ChatMessage(message).toString()
|
|
|
|
class CommandError extends Error {
|
|
constructor (message, filename, lineError) {
|
|
super(stringify(message), filename, lineError)
|
|
this.name = 'CommandError'
|
|
this._message = message
|
|
|
|
}
|
|
|
|
get message () {
|
|
return stringify(this._message)
|
|
}
|
|
}
|
|
module.exports = CommandError
|