Give a descriptive first error line on startup crash, which are probably due to bad view

svn: r20392
This commit is contained in:
Benny Malengier 2012-09-15 08:52:42 +00:00
parent ebf197ad8e
commit bbd1617d66
2 changed files with 9 additions and 4 deletions

View File

@ -329,7 +329,14 @@ def __startgramps(errors, argparser):
except:
quit_now = True
exit_code = 1
LOG.error("Gramps failed to start.", exc_info=True)
LOG.error(_(
"\nGramps failed to start. Please report a bug about this.\n"
"This could be because of an error in a (third party) View on startup.\n"
"To use another view, don't load a family tree, change view, and then load"
" your family tree.\n"
"You can also change manually the startup view in the gramps.ini file \n"
"by changing the last-view parameter.\n"
), exc_info=True)
if quit_now:
#stop gtk loop and quit

View File

@ -38,14 +38,12 @@ class GtkHandler(logging.Handler):
logging.Handler.__init__(self)
self._rotate_handler = rotate_handler
def emit(self, record):
"""
Add the record to the rotating buffer.
"""
self._record = record
ErrorView(error_detail=self,rotate_handler=self._rotate_handler)
ErrorView(error_detail=self, rotate_handler=self._rotate_handler)
def get_formatted_log(self):
return self.format(self._record)