mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-24 21:07:26 +08:00
This commit is contained in:
parent
b6c7b87440
commit
d9d57d02b2
@ -129,7 +129,7 @@ public class AbstractColQuery<SubType extends AbstractColQuery<SubType>> impleme
|
||||
try {
|
||||
return query.count();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -427,7 +427,7 @@ public class AbstractColQuery<SubType extends AbstractColQuery<SubType>> impleme
|
||||
try {
|
||||
return createIterator(projection);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("error", e);
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ public class JaninoEvaluator implements Evaluator{
|
||||
Class<?> type = expr.getType() != null ? expr.getType() : Object.class;
|
||||
ev = new JavaSerializer(ops).handle(expr).createExpressionEvaluator(sources, type);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,11 @@ public class JaninoEvaluator implements Evaluator{
|
||||
try {
|
||||
return (T)ev.evaluate(args);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
if (e.getCause() instanceof NullPointerException){
|
||||
throw new IllegalArgumentException("null path in expression");
|
||||
}else{
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -112,7 +112,7 @@ public class FilteringMultiIterator extends MultiIterator implements IteratorSou
|
||||
} catch (Exception e) {
|
||||
String error = "Caught " + e.getClass().getName();
|
||||
logger.error(error, e);
|
||||
throw new RuntimeException(error, e);
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
|
||||
@ -73,8 +73,7 @@ public class JavaOps extends OperationPatterns {
|
||||
add(op, "Math."+getPattern(op));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String error = "Caught " + e.getClass().getName();
|
||||
throw new RuntimeException(error, e);
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
add(Ops.OpMath.MOD, "%s %% %s");
|
||||
|
||||
|
||||
@ -171,7 +171,16 @@ public class ColQueryTest extends AbstractQueryTest{
|
||||
assertNotNull($(c.getKittensByName()));
|
||||
assertNotNull($(c.getKittensByName().get("Kitty")));
|
||||
from(c,cats)
|
||||
.where($(c.getKittensByName().get("Kitty")).isnotnull()).list(cat);
|
||||
.where($(c.getKittensByName().get("Kitty")).isnotnull()).list(cat);
|
||||
|
||||
// 11
|
||||
try{
|
||||
from(cat,cats).where(cat.mate.alive).list(cat);
|
||||
fail("expected RuntimeException");
|
||||
}catch(RuntimeException e){
|
||||
assertEquals("null path in expression", e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Loading…
Reference in New Issue
Block a user