Skip to content

The gui doesn't handle exceptions very well #18643

@maflcko

Description

@maflcko

The GUI crashes on exceptions such as NonFatalCheckError. I think it is more user friendly for a GUI to catch the exception and display it to the user, then abort the current action and leave the main window running.

I tested this by mutating the conditional in a CHECK_NONFATAL.

$ ./src/qt/bitcoin-qt 
QSocketNotifier: Can only be used with threads started with QThread


************************
EXCEPTION: 18NonFatalCheckError       
wallet/wallet.cpp:2636 (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 Runaway exception       

terminate called after throwing an instance of 'NonFatalCheckError'
  what():  wallet/wallet.cpp:2636 (IsCurrentForAntiFeeSniping)
Internal bug detected: '!chain.findBlock(block_hash, FoundBlock().time(block_time))'
You may report this issue here: https://github.com/bitcoin/bitcoin/issues

Aborted (core dumped)

Screenshot from 2020-04-14 21-11-32

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions