comparison piecrust/data/builder.py @ 406:9caaf78a17db

debug: Log error when an exception gets raised during debug info building.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 25 May 2015 18:35:27 -0700
parents 4b1019bb2533
children f1b759c188b0
comparison
equal deleted inserted replaced
405:1970e7e3a18e 406:9caaf78a17db
95 self._data = None 95 self._data = None
96 96
97 @property 97 @property
98 def debug_info(self): 98 def debug_info(self):
99 if self._page is not None and self._data is not None: 99 if self._page is not None and self._data is not None:
100 return build_debug_info(self._page, self._data) 100 try:
101 return build_debug_info(self._page, self._data)
102 except Exception as ex:
103 logger.exception(ex)
104 return ('An error occured while generating debug info. '
105 'Please check the logs.')
101 return '' 106 return ''
102 107
103 def _enableDebugInfo(self, page, data): 108 def _enableDebugInfo(self, page, data):
104 self._page = page 109 self._page = page
105 self._data = data 110 self._data = data