debug typeerror exceptions

This commit is contained in:
rimu 2024-02-29 11:01:52 +13:00
parent 33ef0658ab
commit 2252c23794

View file

@ -460,12 +460,22 @@ def process_inbox_request(request_json, activitypublog_id, ip_address):
in_reply_to = request_json['object']['inReplyTo'] if 'inReplyTo' in request_json['object'] else None in_reply_to = request_json['object']['inReplyTo'] if 'inReplyTo' in request_json['object'] else None
if not in_reply_to: if not in_reply_to:
if can_create_post(user, community): if can_create_post(user, community):
try:
post = create_post(activity_log, community, request_json, user) post = create_post(activity_log, community, request_json, user)
except TypeError as e:
activity_log.exception_message = 'TypeError. See log file.'
current_app.logger.error('TypeError: ' + str(request_json))
post = None
else: else:
post = None post = None
else: else:
if can_create_post_reply(user, community): if can_create_post_reply(user, community):
try:
post = create_post_reply(activity_log, community, in_reply_to, request_json, user) post = create_post_reply(activity_log, community, in_reply_to, request_json, user)
except TypeError as e:
activity_log.exception_message = 'TypeError. See log file.'
current_app.logger.error('TypeError: ' + str(request_json))
post = None
else: else:
post = None post = None
else: else: