Add error handler to this for some reason
I got a maximum call stack size exceeded error in this code...
This commit is contained in:
parent
b5da5fe50c
commit
9f99a1bbf1
1 changed files with 10 additions and 0 deletions
|
@ -8,4 +8,14 @@ const parse = function (data) {
|
|||
return data
|
||||
}
|
||||
}
|
||||
const parse2 = function (_data) {
|
||||
try {
|
||||
return parse(_data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return {
|
||||
text: 'An error occured while parsing a message. See console for more information.'
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = parse
|
||||
|
|
Loading…
Reference in a new issue