summaryrefslogtreecommitdiff
path: root/src/poezio.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-08-31 22:41:36 +0200
committermathieui <mathieui@mathieui.net>2012-08-31 22:41:36 +0200
commit84887d17af1e445652074b5611df92799069f173 (patch)
treebe01199a88131b2d5932d6feaeadeb360155cdf0 /src/poezio.py
parent2c95177fbeb606dd5f77c226b02fb28ade60d24a (diff)
downloadpoezio-84887d17af1e445652074b5611df92799069f173.tar.gz
poezio-84887d17af1e445652074b5611df92799069f173.tar.bz2
poezio-84887d17af1e445652074b5611df92799069f173.tar.xz
poezio-84887d17af1e445652074b5611df92799069f173.zip
Fix a traceback when a group has no name and a crash when dns gets interrupted
- http://pastebin.archlinux.fr/449676
Diffstat (limited to 'src/poezio.py')
-rw-r--r--src/poezio.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/poezio.py b/src/poezio.py
index 1823b2ec..c013883c 100644
--- a/src/poezio.py
+++ b/src/poezio.py
@@ -33,9 +33,16 @@ def main():
cocore = singleton.Singleton(core.Core)
signal.signal(signal.SIGHUP, cocore.sighup_handler) # ignore ctrl-c
cocore.start()
- if not cocore.xmpp.start(): # Connect to remote server
- cocore.on_failed_connection()
- cocore.main_loop() # Refresh the screen, wait for user events etc
+ try:
+ if not cocore.xmpp.start(): # Connect to remote server
+ cocore.on_failed_connection()
+ except:
+ cocore.running = False
+ cocore.reset_curses()
+ print("Poezio could not start, maybe you tried aborting it while it was starting?\n"
+ "If you think it is abnormal, please run it with the -d option and report the bug.")
+ else:
+ cocore.main_loop() # Refresh the screen, wait for user events etc
if __name__ == '__main__':
main()