-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug json.exception.type_error.302 #4492
Comments
Is that the full json file? That's not a valid file. |
the complete Json it returns the bot token normally, the bot starts up to a certain point, I will give you a reference for this: This is the terminal log: Conteúdo do JSON carregado: {"token":"MTMwMTYyNDA4MzE5NjI4MDg3Mw.GchdbE.mPQ-y7CshnlSz-ZD6IYmctJXWR4D8RfYeUCHCI"} As said, it turns on, but it aborts the operation due to this error |
Your exception is not in this code that you've shared here. This code executes completely. You can see the It must be some other usage in the |
But I only use the library in this part of the code, but I can tell you where it says the bot is starting, here it is: ` bot.on_slashcommand([this](const slashcommand_t& event) { void Bot::start(){ bot.on_ready([this](const ready_t& event) { void Bot::register_commands(){ } void Bot::handle_command(const slashcommand_t& event){ if(command_map.find(command_name) != command_map.end()){ he recorded the commands |
As far as I can see, it is not possible for this code to throw that error. This error (code 302, mentioning array) is only thrown by Could you try removing the library from |
Yes, I have already removed the library and it still happens, could it be a memory error? I also had the same thought about this error, I'm not using it anywhere else in the code except in main. |
Are you using any third party libraries that might include it? |
No, I'm just using it at the moment. To actually pull just the token |
I can't see what would be causing this then. You'll probably have to run it under a debugger and set it to stop when an exception is thrown. |
I tried to put exceptions so the bot doesn't shut down, but it still doesn't fall into the block, it just aborts the program. If you want to analyze the code, it's in my github repository pinned |
Try with diagnostics enabled to maybe get a path to the mistyped element. In any way, please share a minimal example so we don't need to guess which other code might trigger the warning. |
You're using |
So the problem is there? Isn't it from json? or is the problem my code? What exactly does this mean? |
I just tested it on my friend's pc and it worked on his |
The exception is from this library, but it's from something that the |
@OyakXD Just to make sure: did you revoke the token you shared in the example above? |
Description
I'm creating a bot for discord and it's falling into this exception, for no reason at all, I've already added all kinds of checks, all kinds of try catches, but it breaks all the time when I call it, it even shows the correct token
Reproduction steps
When I turn on the bot it starts everything fine, then at the end it launches the message and breaks
Expected vs. actual results
I get results
Minimal code example
Error messages
Compiler and operating system
I'm using gcc in linux, but atuality i am using cmake with build
Library version
master
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: