def METHOD_NAME(fieldset, pset_mode, mode, type):
    """Test that checks errors thrown for unsupported dtypes in JIT mode."""
    class TestParticle(ptype[mode]):
        p = Variable('p', dtype=type, initial=10.)
    error_thrown = False
    try:
        pset_type[pset_mode]['pset'](fieldset, pclass=TestParticle, lon=[0], lat=[0])
    except (RuntimeError, TypeError):
        error_thrown = True
    assert error_thrown