def METHOD_NAME(custom_format_name):
    class Custom(TimeFormat):
        name = custom_format_name
        def set_jds(self, val, val2):
            raise SpecificException
    try:
        Time(7.0, format=custom_format_name)
    except ValueError as e:
        assert hasattr(e, "__cause__") and isinstance(e.__cause__, SpecificException)