def _handle_comment_response_error()

in bugbounty_gpt/handlers/submission_handler.py [0:0]


    def _handle_comment_response_error(self, response):
        """
        Handles the error response for a comment creation request.

        :param response: Response object from the comment creation operation.
        """
        try:
            error_message = response.json()["errors"][0]["detail"]
        except (json.JSONDecodeError, KeyError, IndexError):
            error_message = "An error occurred, but the response is not a valid JSON object."
        logger.error("Error: " + error_message)