#1755 closed defect (fixed)
sugar-emulator: better error message if X server is unreachable
Reported by: | sascha_silbe | Owned by: | sascha_silbe |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | |
Component: | Sugar | Version: | Git as of bugdate |
Severity: | Trivial | Keywords: | r+ |
Cc: | tomeu | Distribution/OS: | Unspecified |
Bug Status: | Assigned |
Description
Seems I didn't test the error case of not being able to connect to the X server at all. Reported by yevlempy on sugar-devel:
Xephyr cannot open host display. Is DISPLAY set? Xephyr cannot open host display. Is DISPLAY set? Xephyr cannot open host display. Is DISPLAY set? Xephyr cannot open host display. Is DISPLAY set? Xephyr cannot open host display. Is DISPLAY set? Xephyr cannot open host display. Is DISPLAY set? Xephyr cannot open host display. Is DISPLAY set? Xephyr cannot open host display. Is DISPLAY set? xrdb: No such file or directory xrdb: Can't open display ':39' Window manager error: Unable to open X display :39 1267079814.2631569 STARTUP: Starting the shell Traceback (most recent call last): File "/home/Rinki/project/sugar-jhbuild/install/bin/sugar-session", line 32, in <module> import gtk File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module> _init() File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init _gtk.init_check() RuntimeError: could not open display Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/Rinki/project/sugar-jhbuild/install/lib/python2.6/site-packages/jarabe/util/emulator.py", line 156, in main _kill_pipe(server) File "/home/Rinki/project/sugar-jhbuild/install/lib/python2.6/site-packages/jarabe/util/emulator.py", line 80, in _kill_pipe os.kill(pipe.pid, signal.SIGTERM) AttributeError: 'NoneType' object has no attribute 'pid'
Attachments (1)
Change History (9)
comment:1 Changed 13 years ago by sascha_silbe
- Keywords r? added
- Status changed from new to accepted
comment:2 Changed 13 years ago by erikos
- Milestone changed from 0.88 to 0.88.x
comment:3 follow-up: ↓ 4 Changed 13 years ago by tomeu
- Keywords r! added; r? removed
+ sys.stderr.write('Error executing server: %s\n' % (exc, ))
Better print the full exception including the traceback? If cannot use logging.error, then see in http://docs.python.org/library/traceback.html .
+ if not pipe:
+ if not server:
Always use "is None", classes implementing a collection protocol evaluate to False when empty.
comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 13 years ago by sascha_silbe
- Cc tomeu added
- Keywords r? added; r! removed
Replying to tomeu:
+ sys.stderr.write('Error executing server: %s\n' % (exc, ))
Better print the full exception including the traceback?
That will add no useful information and instead confuse the user.
+ if not pipe:
+ if not server:
Always use "is None", classes implementing a collection protocol evaluate to False when empty.
Changed.
comment:5 in reply to: ↑ 4 ; follow-up: ↓ 6 Changed 13 years ago by tomeu
Replying to sascha_silbe:
Replying to tomeu:
+ sys.stderr.write('Error executing server: %s\n' % (exc, ))
Better print the full exception including the traceback?
That will add no useful information and instead confuse the user.
I don't agree with this, asked in the ml for opinions.
comment:6 in reply to: ↑ 5 Changed 13 years ago by tomeu
- Keywords r+ added; r? removed
- Resolution set to fixed
- Status changed from accepted to closed
Replying to tomeu:
Replying to sascha_silbe:
Replying to tomeu:
+ sys.stderr.write('Error executing server: %s\n' % (exc, ))
Better print the full exception including the traceback?
That will add no useful information and instead confuse the user.
I don't agree with this, asked in the ml for opinions.
Not such a big deal, pushed as http://git.sugarlabs.org/projects/sugar/repos/mainline/commits/cb4fdde40a5
comment:7 Changed 13 years ago by sascha_silbe
Thanks!
No show stopper.