add exception handler
This commit is contained in:
@@ -102,7 +102,12 @@ class Post(models.Model):
|
|||||||
if not self.agenda_key:
|
if not self.agenda_key:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
html = getPadHTML(self.agenda_key)
|
try:
|
||||||
|
html = getPadHTML(self.agenda_key)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error("Can't get the agenda html from agenda key '{}'. Error: {}".format(self.agenda_key, e))
|
||||||
|
html = None
|
||||||
|
|
||||||
return html
|
return html
|
||||||
|
|
||||||
@agenda_html.setter
|
@agenda_html.setter
|
||||||
|
|||||||
@@ -74,10 +74,18 @@ def show(request, id=None):
|
|||||||
ep_protocol_link = "#"
|
ep_protocol_link = "#"
|
||||||
|
|
||||||
if p.has_agenda and p.agenda_key:
|
if p.has_agenda and p.agenda_key:
|
||||||
ep_agenda_link = get_pad_link(p.agenda_key)
|
try:
|
||||||
|
ep_agenda_link = get_pad_link(p.agenda_key)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error("Can't get the agenda link from '{}'. Error: {}".format(p.agenda_key, e))
|
||||||
|
ep_agenda_link = "#"
|
||||||
|
|
||||||
if p.has_protocol and p.protocol_key:
|
if p.has_protocol and p.protocol_key:
|
||||||
ep_protocol_link = get_pad_link(p.protocol_key)
|
try:
|
||||||
|
ep_protocol_link = get_pad_link(p.protocol_key)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error("Can't get the protocol link from '{}'. Error: {}".format(p.protocol_key, e))
|
||||||
|
ep_protocol_link = "#"
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
"post": p,
|
"post": p,
|
||||||
|
|||||||
Reference in New Issue
Block a user