'Create and return usage_key or error Response.
Arguments:
usage_id (string): The id of required block.'

def get_usage_key_or_error_response(self, usage_id):

    try:
        return UsageKey.from_string(usage_id)
    except InvalidKeyError:
        error_message = ugettext_noop(u'Invalid    usage_id:    {usage_id}.').format(usage_id=usage_id)
        log.error(error_message)
        return self.error_response(error_message, error_status=status.HTTP_404_NOT_FOUND)
