Closed Spixmaster closed 5 years ago
Use try-catch
.
@JellyBrick Thanks! That helps me a lot. I was despairing.
Nevertheless, I find the definition at in Api.cpp at line 1142 but where is the exception that can occur thrown? What exception is even thrown?
I'd be so grateful if you could help me with this problem.
@Spixmaster TgBot::TgException
is thrown.
This is the relevant code. The intention is that it is only allowed to write messages in a group which start with "Dx10".
Following problem occurs. I happens from time to time that the application crashes. The programm can be started again if the code above is commented out. I highly assume that the program crashes due to the function deleteMessage() which tries to delete a non-existent message. The only reason for this is that a user deletes a message before the program does it. Deleting non-existent messages lets the app crash.
My question: Is there a possibility to check whether the message with the corresponding messageId is still existent?