Error format
Hello !
I'm testing to create a channel when the category is full. I get this error in a catch() of create():
Why I need to access to
error.rawError.errors.parent_id._errors[0].code
to get the error ?
In a different situation, for example when I can't send a DM to a user, it's much clearer than that5 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by staffask discord
Because this is the invalid form body error and the error may occur in any of properties, in your case it's
parent_id
.The message itself is more complex : Invalid Form Body
parent_id[CHANNEL_PARENT_MAX_CHANNELS]: Maximum number of channels in category reached (50)
But it's strange not to have a clear message for this error. It's not really an Invalid Body
Wa can know before if the category is full ?
Check the count of children of the category