def handle_type_error(fn):
    @wraps(fn)
    def handle_type_error_wrapper(*args, **kwargs):
        def any_match(string_list, obj):
            return filter(lambda x: x in obj, string_list)

        try:
            return fn(*args, **kwargs)
        except TypeError as e:
            str_list = [
                "takes exactly",
                "got an unexpected",
                "takes no argument",
            ]
            if fn.__name__ in e.message and any_match(str_list, e.message):
                raise HTTPError(400, e.message)

            raise  # This will cause 500: Internal server error

    return handle_type_error_wrapper
Obtain the list of aliases
dataset/ETHPy150Open Bystroushaak/bottle-rest/src/bottle_rest/bottle_rest.py/handle_type_error--crossover with--dataset/ETHPy150Open drslump/pyshould/pyshould/matchers.py/aliases