karastojko / mailio

mailio is a cross platform C++ library for MIME format and SMTP, POP3 and IMAP protocols. It is based on standard C++ 17 and Boost library.
Other
374 stars 98 forks source link

Catching 'dialog_error' #97

Closed MrBruz closed 2 years ago

MrBruz commented 2 years ago

Catch doesn't seem to properly catch dialog_error, what is the fix for this issue in my code?

catch (dialog_error &exc)
{
    cout << email << " - Dialog Error: " << exc.what() << endl;
}
terminate called after throwing an instance of 'mailio::dialog_error'
  what():  Server connecting failed.
[1]    24850 IOT instruction (core dumped) 
karastojko commented 2 years ago

Hi, is it possible to get the code inside try?

MrBruz commented 2 years ago

Hey @karastojko I appreciate the help, it turns out that the initial IMAP connect function was not inside the try/except, causing this error.