mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 12:52:35 -03:00
Merge pull request #1097 from laanwj/2012_04_runawayexception
Show a message box when runaway exception happens
This commit is contained in:
commit
9ea8e60a0c
1 changed files with 11 additions and 2 deletions
|
@ -119,6 +119,15 @@ std::string _(const char* psz)
|
||||||
return QCoreApplication::translate("bitcoin-core", psz).toStdString();
|
return QCoreApplication::translate("bitcoin-core", psz).toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Handle runaway exceptions. Shows a message box with the problem and quits the program.
|
||||||
|
*/
|
||||||
|
static void handleRunawayException(std::exception *e)
|
||||||
|
{
|
||||||
|
PrintExceptionContinue(e, "Runaway exception");
|
||||||
|
QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occured. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define strncasecmp strnicmp
|
#define strncasecmp strnicmp
|
||||||
#endif
|
#endif
|
||||||
|
@ -284,9 +293,9 @@ int main(int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
PrintException(&e, "Runaway exception");
|
handleRunawayException(&e);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
PrintException(NULL, "Runaway exception");
|
handleRunawayException(NULL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue