<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _on_github_request(self, future, response):
 """Invoked as a response to the GitHub API request. Will decode the response and set the result for the future to return the callback or raise an exception """

        try:
            content = escape.json_decode(response.body)
        except ValueError as error:
            future.set_exception(Exception('Github error: %s' %
                                           response.body))
            return

        if 'error' in content:
            future.set_exception(Exception('Github error: %s' %
                                           str(content['error'])))
            return
        future.set_result(content)