Closed yappy closed 3 years ago
I'm using cmake default configuration. (websocketpp) SleepyDiscord::USER_CONTROLED_THREADS (=1)
Looks like a error wasn't handled. You can turn off the throw when making a request but I would recommend doing a try catch or an if error. here's some pseudocode examples:
try {
Message mess = send Message();
Or
auto mmm = send Message ();
if(mmm.error()) {
Or
Message mess;
If(send message().cast(mess)) {
some of these require changing the request mode to work tho, here's a list of them https://github.com/yourWaifu/sleepy-discord/blob/7796a1fd6003eb75511068e0c206aaada6198213/include/sleepy_discord/client.h#L88-L98
Thanks, understood. I confirmed that request mode default is Sync_AsyncQueue and it includes ThrowError bit.
I wrote a onMessage event handler, which calls sendMessage() to reply. (simply like example) sendMessage() may throw an enum (from client.cpp:154), sometimes client->run() throws it and I could catch it and re-run, but sometimes the event handler is called from asio internal thread and it causes crash. (SIGABRT)
Example: sendMessage() throws SleepyDiscord::ErrorCode See # 6 and # 23.