Skip to content

Commit 3c05402

Browse files
better handling of invocationtargetexception (#968)
* better handling of invocationtargetexception * address review comments * address review comments
1 parent 541eca8 commit 3c05402

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/io/appium/java_client/remote/AppiumCommandExecutor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,16 @@ public Result createSession(HttpClient client, Command command)
191191
return toReturn;
192192
}).orElseThrow(() -> new SessionNotCreatedException(
193193
format("Unable to create new remote session. desired capabilities = %s", desired)));
194-
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
194+
} catch (NoSuchMethodException | IllegalAccessException e) {
195195
throw new WebDriverException(format("It is impossible to create a new session "
196196
+ "because 'createSession' which takes %s, %s and %s was not found "
197197
+ "or it is not accessible",
198198
HttpClient.class.getSimpleName(),
199199
InputStream.class.getSimpleName(),
200200
long.class.getSimpleName()), e);
201+
} catch (InvocationTargetException e) {
202+
throw new SessionNotCreatedException(
203+
format("Unable to create new remote session. Desired capabilities: %s", desired), e);
201204
}
202205
} finally {
203206
os.reset();

0 commit comments

Comments
 (0)