Simplify exception handling in JsonPathExpectationsHelper

This commit is contained in:
Sam Brannen 2016-08-26 14:43:40 +02:00
parent 2e4a7480fc
commit 5998a297ce
1 changed files with 2 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -227,13 +227,7 @@ public class JsonPathExpectationsHelper {
try {
return this.jsonPath.read(content);
}
catch (InvalidPathException ex) {
throw new AssertionError(message + ex.getMessage());
}
catch (ArrayIndexOutOfBoundsException ex) {
throw new AssertionError(message + ex.getMessage());
}
catch (IndexOutOfBoundsException ex) {
catch (InvalidPathException | IndexOutOfBoundsException ex) {
throw new AssertionError(message + ex.getMessage());
}
}