<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _handle_error(self, result, err_msg):
 """Check result for error :type result: dict :param result: response body :type err_msg: str :param err_msg: The message given to the :class:`RequestError` instance raised :returns: Actual result from result :raises RequestError: If result has error """

        if result.get(u'error'):
            raise RequestError("{}\nResponse: {}".format(
                err_msg,
                json.dumps(result, indent=2)
            ))
        else:
            return result.get(u'result')