<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_exception(self, response):
 """ Sends an exception page with a 500 error code. Must be called from inside the exception handling block. :param response: The response handler """

        # Get a formatted stack trace
        stack = traceback.format_exc()

        # Log the error
        self.log_error(
            "Error handling request upon: %s\n%s\n", self.path, stack
        )

        # Send the page
        response.send_content(
            500, self._service.make_exception_page(self.path, stack)
        )