-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
json::parse() into a vector<string> results in unhandled exception #1587
Comments
Occurs at line 2964
|
What is the |
What do you mean by the what() output? |
When you catch the |
What is the last line in your code before the exception is triggered? It seems to be a conversion to a string type. |
std::string strdat = cblox::User::GetFriends(userId); The value the function returns is also a string |
Ok, I got it to work, but as soon as I try to assign it to a vector array it doesn't like it |
Nevermind, got it working now by using json instead of vector. |
When using json::parse() to parse into a vector, my program crashes with an unhandled exception.
Error: Unhandled exception at 0x767FC6F2 in Project2.exe: Microsoft C++ exception: nlohmann::detail::parse_error at memory location 0x0133E1E8.
My code:
std::string strdat = cblox::User::GetFriends(userId); std::vector<string> data = json::parse(strdat);
It should output the following JSON line by line:
[{"Id":257718708,"Username":"Hamburgare50","AvatarUri":"http://t7.rbxcdn.com/c3e30a0ce1554cd22a6e0ef438280bd1","AvatarFinal":true,"IsOnline":false},{"Id":24301726,"Username":"Aczero_Ricky","AvatarUri":"http://t5.rbxcdn.com/2293487bb9adcf4b675740e57dc16279","AvatarFinal":true,"IsOnline":false},{"Id":85831697,"Username":"CharlieSBayley","AvatarUri":"http://t2.rbxcdn.com/3cadde4f20421e7afbf9f15ac1ea6f0c","AvatarFinal":true,"IsOnline":false},{"Id":383446385,"Username":"akgtmc","AvatarUri":"http://t6.rbxcdn.com/fd5c89ad7f859a5c59bc31642995d91e","AvatarFinal":true,"IsOnline":false},{"Id":449091095,"Username":"MacaSParker","AvatarUri":"http://t1.rbxcdn.com/1de575ebb080d400bd3ddda2a44a5803","AvatarFinal":true,"IsOnline":false},{"Id":917026880,"Username":"TheRainbowQueen2019","AvatarUri":"http://t1.rbxcdn.com/0fb8f8ed46dc7b5b239e6ab6b4f94ac3","AvatarFinal":true,"IsOnline":false},{"Id":936167157,"Username":"autozz19999","AvatarUri":"http://t6.rbxcdn.com/f33c0a4aade8f944ef60444dbdc76961","AvatarFinal":true,"IsOnline":false},{"Id":508643792,"Username":"SrslyItsJoe","AvatarUri":"http://t3.rbxcdn.com/e85714e9a96e15bd995e5efa25bb03ee","AvatarFinal":true,"IsOnline":false},{"Id":130668355,"Username":"OllieERichardson","AvatarUri":"http://t3.rbxcdn.com/49a233ae435394ca2e86967e12acb5fd","AvatarFinal":true,"IsOnline":true},{"Id":169640794,"Username":"SherylAFitzalan","AvatarUri":"http://t3.rbxcdn.com/c4738efc48824bfc3ddb28f2913f1652","AvatarFinal":true,"IsOnline":false},{"Id":39016790,"Username":"uwaisfreindali","AvatarUri":"http://t7.rbxcdn.com/ff0565e8e81edecbb5d3209a9407fd19","AvatarFinal":true,"IsOnline":false},{"Id":916870937,"Username":"amigobot236","AvatarUri":"http://t2.rbxcdn.com/2ad9b729aa2eed24ef1a37b1c88c90f6","AvatarFinal":true,"IsOnline":false},{"Id":916787871,"Username":"flacal123","AvatarUri":"http://t1.rbxcdn.com/bb0eb89a17864e8520d5f4b5d62d748d","AvatarFinal":true,"IsOnline":false},{"Id":170000078,"Username":"LaceYear","AvatarUri":"http://t3.rbxcdn.com/a6a2f271e266957030bb0aa838f9d656","AvatarFinal":true,"IsOnline":false},{"Id":210501154,"Username":"NaweRBLX","AvatarUri":"http://t5.rbxcdn.com/4a3824bfa6835ccfadeed1d9c5c8ba57","AvatarFinal":true,"IsOnline":false},{"Id":58077857,"Username":"ewanerd","AvatarUri":"http://t2.rbxcdn.com/0de1ced519971055f2c0bcf4d8cbe823","AvatarFinal":true,"IsOnline":false},{"Id":135886259,"Username":"mrstabby7","AvatarUri":"http://t6.rbxcdn.com/4ae565be7b4ef3c555accc8129f92c90","AvatarFinal":true,"IsOnline":false},{"Id":146113463,"Username":"Chile_C","AvatarUri":"http://t4.rbxcdn.com/c19dfec4aa0a04d5c7755c3e91ad84a2","AvatarFinal":true,"IsOnline":false},{"Id":174047682,"Username":"jemilho","AvatarUri":"http://t3.rbxcdn.com/2768f5b7dec4751d7dddc26f6c3ab3a5","AvatarFinal":true,"IsOnline":false},{"Id":96529580,"Username":"MegaXUltra","AvatarUri":"http://t6.rbxcdn.com/6ebeb4dc8e3b17e53a6f545ac2f1280e","AvatarFinal":true,"IsOnline":false}]
It crashes with the following error: Unhandled exception at 0x767FC6F2 in Project2.exe: Microsoft C++ exception: nlohmann::detail::parse_error at memory location 0x0133E1E8.
Win 10 - MSVC 2017
develop
branch?released
n/a
The text was updated successfully, but these errors were encountered: