Browse Source

Handle exceptions when parsing Filter.

pull/183/merge
Kalle Stenflo 9 years ago
parent
commit
f602f04e92
  1. 8
      json-path/src/main/java/com/jayway/jsonpath/internal/filter/FilterCompiler.java

8
json-path/src/main/java/com/jayway/jsonpath/internal/filter/FilterCompiler.java

@ -40,8 +40,12 @@ public class FilterCompiler {
private CharacterIndex filter; private CharacterIndex filter;
public static Filter compile(String filterString) { public static Filter compile(String filterString) {
FilterCompiler compiler = new FilterCompiler(filterString); try {
return new CompiledFilter(compiler.compile()); FilterCompiler compiler = new FilterCompiler(filterString);
return new CompiledFilter(compiler.compile());
} catch (Exception e){
throw new InvalidPathException("Could not compile inline filter : " + filterString, e);
}
} }
private FilterCompiler(String filterString) { private FilterCompiler(String filterString) {

Loading…
Cancel
Save