def get_comment(comment_id): try: comment = Comment.get(comment_id) except StatementError: raise CommentNotFoundException() if comment is None: raise CommentNotFoundException() return comment