Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/java/io/github/uchagani/jp/ExtensionUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ public static RestConfig getRestConfig(ParameterContext parameterContext, Extens

try {
configClass = parameterContext.getParameter().getAnnotation(UseRestConfig.class).value();
} catch (NullPointerException ignored) {
} catch (Exception ignored) {
try {
configClass = extensionContext.getRequiredTestMethod().getAnnotation(UseRestConfig.class).value();
} catch (NullPointerException ignored1) {
} catch (Exception ignored1) {
try {
configClass = extensionContext.getRequiredTestClass().getAnnotation(UseRestConfig.class).value();
} catch (NullPointerException npe) {
} catch (Exception exception) {
if (parameterContext == null) {
// This should only happen when this method is called from another extension
configClass = EmptyRestConfig.class;
} else {
throw npe;
throw exception;
}
}
}
Expand All @@ -45,7 +45,7 @@ public static BrowserConfig getBrowserConfig(ExtensionContext extensionContext)

try {
configClass = extensionContext.getRequiredTestMethod().getAnnotation(UseBrowserConfig.class).value();
} catch (NullPointerException ignored) {
} catch (Exception ignored) {
configClass = extensionContext.getRequiredTestClass().getAnnotation(UseBrowserConfig.class).value();
}

Expand Down