better errors

This commit is contained in:
ThomasV 2012-03-23 19:32:16 +01:00
parent 7d8f5e1aec
commit 22a0fdd492
3 changed files with 8 additions and 8 deletions

View File

@ -77,7 +77,8 @@ if __name__ == '__main__':
found = wallet.file_exists
if not found:
found = gui.restore_or_create()
except SystemExit, e:
exit(e)
except BaseException, e:
import traceback
traceback.print_exc(file=sys.stdout)

View File

@ -782,7 +782,11 @@ class ElectrumWindow(QMainWindow):
except:
import mnemonic
print "not hex, trying decode"
try:
seed = mnemonic.mn_decode( seed.split(' ') )
except:
QMessageBox.warning(None, 'Error', 'I cannot decode this', 'OK')
sys.exit(0)
if not seed:
QMessageBox.warning(None, 'Error', 'no seed', 'OK')
sys.exit(0)

View File

@ -949,15 +949,11 @@ class Wallet:
if blocks == -1: raise BaseException("session not found")
self.blocks = int(blocks)
if changed_addresses:
#self.is_up_to_date = False
self.was_updated = True
for addr, status in changed_addresses.items():
self.receive_status_callback(addr, status)
#else:
# self.is_up_to_date = True
elif method == 'server.peers':
#print "Received server list: ", result
self.interface.servers = map( lambda x:x[1], result )
elif method == 'address.subscribe':
@ -975,7 +971,6 @@ class Wallet:
elif method == 'numblocks.subscribe':
self.blocks = result
#self.newblock_callback,(result,))
elif method == 'client.version':
pass
@ -1022,4 +1017,4 @@ class Wallet:
addresses = self.all_addresses()
version = self.electrum_version
self.interface.start_session(addresses, version)
#print "Starting new session: %s:%d"%(self.host,self.port)
print "Starting new session: %s:%d"%(self.host,self.port)