diff options
Diffstat (limited to 'src/qt/bitcoin.cpp')
-rw-r--r-- | src/qt/bitcoin.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 55b5f74c3b..42bfcfd0b2 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -109,7 +109,7 @@ static std::string Translate(const char* psz) 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)); + QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning)); exit(1); } @@ -126,13 +126,21 @@ int main(int argc, char *argv[]) const char *strURI = argv[i]; try { boost::interprocess::message_queue mq(boost::interprocess::open_only, BITCOINURI_QUEUE_NAME); - if(mq.try_send(strURI, strlen(strURI), 0)) + if (mq.try_send(strURI, strlen(strURI), 0)) + // if URI could be sent to the message queue exit here exit(0); else + // if URI could not be sent to the message queue do a normal Bitcoin-Qt startup break; } catch (boost::interprocess::interprocess_exception &ex) { - break; + // don't log the "file not found" exception, because that's normal for + // the first start of the first instance + if (ex.get_error_code() != boost::interprocess::not_found_error) + { + printf("main() - boost interprocess exception #%d: %s\n", ex.get_error_code(), ex.what()); + break; + } } } } @@ -264,7 +272,7 @@ int main(int argc, char *argv[]) // TODO: implement URI support on the Mac. #if !defined(MAC_OSX) - // Place this here as guiref has to be defined if we dont want to lose URIs + // Place this here as guiref has to be defined if we don't want to lose URIs ipcInit(); // Check for URI in argv @@ -278,6 +286,8 @@ int main(int argc, char *argv[]) mq.try_send(strURI, strlen(strURI), 0); } catch (boost::interprocess::interprocess_exception &ex) { + printf("main() - boost interprocess exception #%d: %s\n", ex.get_error_code(), ex.what()); + break; } } } @@ -289,7 +299,7 @@ int main(int argc, char *argv[]) window.setWalletModel(0); guiref = 0; } - // Shutdown the core and it's threads, but don't exit Bitcoin-Qt here + // Shutdown the core and its threads, but don't exit Bitcoin-Qt here Shutdown(NULL); } else |