def __new__(mcs, *args, **kwargs):
        name = args[0]
        bases = args[1]
        members = args[2].copy()

        rules = members.get('rules', [])
        for base in (base for base in bases if hasattr(base, 'rules')):
            for base_rule in base.rules:
                if not any(base_rule.rule == rule.rule and
                        set(base_rule.methods).intersection(set(rule.methods))
                            for rule in rules):
                    rules.append(base_rule)

        url_map = members.get('url_map', Map())
        for rule in rules:
            url_map.add(
                Rule(rule.rule, methods=rule.methods, endpoint=rule.endpoint)
            )

        members['rules'] = list(url_map.iter_rules())
        members['url_map'] = url_map

        return super(mcs, mcs).__new__(mcs, *(name, bases, members), **kwargs)
Retrieve error message from error, if available.
dataset/ETHPy150Open lvieirajr/mongorest/mongorest/resource.py/ResourceMeta.__new__--crossover with--dataset/ETHPy150Open CenterForOpenScience/osf.io/framework/transactions/utils.py/get_error_message