window: capture error on pygame.display.set_mode too.

This commit is contained in:
Mathieu Virbel 2012-01-20 23:49:02 +01:00
parent 343d71b495
commit ba3d349666
2 changed files with 6 additions and 3 deletions

View File

@ -68,8 +68,8 @@ else:
except CoreCriticalException as e:
Logger.error('%s: Unable to use <%s> as %s'
'provider' % (category.capitalize(), option, category))
Logger.error('%s: The module raised an important error' %
(category.capitalize()))
Logger.error('%s: The module raised an important error: %r' %
(category.capitalize(), e.message))
raise
except Exception as e:

View File

@ -113,7 +113,10 @@ class WindowPygame(WindowBase):
pygame.display.gl_set_attribute(pygame.GL_MULTISAMPLEBUFFERS, 0)
pygame.display.gl_set_attribute(pygame.GL_MULTISAMPLESAMPLES, 0)
multisamples = 0
self._pygame_set_mode()
try:
self._pygame_set_mode()
except pygame.error, e:
raise CoreCriticalException(e.message)
else:
Logger.warning('WinPygame: Video setup failed :-(')
raise