Skip to content

Commit 88ed93d

Browse files
Flanker-MSFTFlanker-MSFT
authored andcommitted
Swallow exception when check whether project is a valid function project
1 parent 59fb121 commit 88ed93d

File tree

1 file changed

+11
-7
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/function/runner/core

1 file changed

+11
-7
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice-java/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/function/runner/core/FunctionUtils.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,17 @@ public static boolean isFunctionProject(Project project) {
180180
return false;
181181
}
182182
final List<Library> libraries = new ArrayList<>();
183-
OrderEnumerator.orderEntries(project).productionOnly().forEachLibrary(library -> {
184-
if (StringUtils.containsAnyIgnoreCase(library.getName(), AZURE_FUNCTIONS_JAVA_LIBRARY, AZURE_FUNCTIONS_JAVA_CORE_LIBRARY)) {
185-
libraries.add(library);
186-
}
187-
return true;
188-
});
189-
return libraries.size() > 0;
183+
try {
184+
OrderEnumerator.orderEntries(project).productionOnly().forEachLibrary(library -> {
185+
if (StringUtils.containsAnyIgnoreCase(library.getName(), AZURE_FUNCTIONS_JAVA_LIBRARY, AZURE_FUNCTIONS_JAVA_CORE_LIBRARY)) {
186+
libraries.add(library);
187+
}
188+
return true;
189+
});
190+
return libraries.size() > 0;
191+
} catch (Throwable t) {
192+
return false;
193+
}
190194
}
191195

192196
@AzureOperation(name = "boundary/function.list_function_methods.module", params = {"module.getName()"})

0 commit comments

Comments
 (0)