0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-09 15:37:00 -04:00
bitcoin-core/src/qt/test
W. J. van der Laan 03ecceedf6
Merge #260: Handle exceptions instead of crash
b8e5d0d3fe qt: Handle exceptions in SendCoinsDialog::sendButtonClicked slot (Hennadii Stepanov)
1ac2bc7ac0 qt: Handle exceptions in TransactionView::bumpFee slot (Hennadii Stepanov)
bc00e13bc8 qt: Handle exceptions in WalletModel::pollBalanceChanged slot (Hennadii Stepanov)
eb6156ba1b qt: Handle exceptions in BitcoinGUI::addWallet slot (Hennadii Stepanov)
f7e260a471 qt: Add GUIUtil::ExceptionSafeConnect function (Hennadii Stepanov)
64a8755af3 qt: Add BitcoinApplication::handleNonFatalException function (Hennadii Stepanov)
af7e365b15 qt: Make PACKAGE_BUGREPORT link clickable (Hennadii Stepanov)

Pull request description:

  This PR is an alternative to https://github.com/bitcoin/bitcoin/pull/18897, and is based on Russ' [idea](https://github.com/bitcoin/bitcoin/pull/18897#pullrequestreview-418703664):
  > IMO it would be nice to have a followup PR that eliminated the one-line forwarding methods ...

  Related issues
  - #91
  - https://github.com/bitcoin/bitcoin/issues/18643

  Qt docs: https://doc.qt.io/qt-5.12/exceptionsafety.html#exceptions-in-client-code

  With this PR the GUI handles the wallet-related exception, and:
  - display it to a user:

  ![Screenshot from 2021-04-01 02-55-59](https://user-images.githubusercontent.com/32963518/113226183-33ff8480-9298-11eb-8fe6-2168834ab09a.png)

  - prints a message to `stderr`:
  ```

  ************************
  EXCEPTION: 18NonFatalCheckError
  wallet/wallet.cpp:2677 (IsCurrentForAntiFeeSniping)
  Internal bug detected: '!chain.findBlock(block_hash, FoundBlock().time(block_time))'
  You may report this issue here: https://github.com/bitcoin/bitcoin/issues

  bitcoin in QPushButton->SendCoinsDialog

  ```

  - writes a message to the `debug.log`
  - and, if the exception is a non-fatal error, leaves the main window running.

ACKs for top commit:
  laanwj:
    Code review ACK b8e5d0d3fe
  ryanofsky:
    Code review ACK b8e5d0d3fe. This is great! I think more improvements are possible but implementation is very clean and I love how targeted each commit is. Changes since last review: adding more explanatory text, making links clickable, reorganizing.

Tree-SHA512: a9f2a2ee8e64b993b0dbc454edcbc39c68c8852abb5dc1feb58f601c0e0e8014dca81c72733aa3fb07b619c6f49b823ed20c7d79cc92088a3abe040ed2149727
2021-04-14 14:17:30 +02:00
..
addressbooktests.cpp scripted-diff: remove Optional & nullopt 2021-03-15 10:41:30 +08:00
addressbooktests.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
apptests.cpp validation: Pass in chainman to UnloadBlockIndex 2020-09-15 14:11:34 -04:00
apptests.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
Makefile build: add stub makefiles for easier subdir builds 2014-06-05 16:05:43 -04:00
rpcnestedtests.cpp Merge #21557: test: small cleanup in RPCNestedTests tests 2021-04-06 08:45:08 +02:00
rpcnestedtests.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
test_main.cpp test: remove qt byteswap compattests 2021-03-29 11:12:26 +08:00
uritests.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
uritests.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
util.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
util.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
wallettests.cpp qt: Handle exceptions in SendCoinsDialog::sendButtonClicked slot 2021-04-05 16:47:31 +03:00
wallettests.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00