Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Re-interrupt from catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
sadmananik committed Oct 16, 2023
1 parent 80f0aa9 commit ee86f43
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public int runScanner(Map<String, Object> scanParams, FilePath bridgeInstallatio
.join();
} catch (Exception e) {
logger.error(LogMessages.EXCEPTION_OCCURRED_WHILE_INVOKING_SYNOPSYS_BRIDGE, e.getMessage());
Thread.currentThread().interrupt();
} finally {
logger.println("******************************* %s *******************************", "END EXECUTION OF SYNOPSYS BRIDGE");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public boolean checkIfBridgeInstalled(String synopsysBridgeInstallationPath) {
}
} catch (IOException | InterruptedException e) {
logger.error("An exception occurred while checking if the bridge is installed: " + e.getMessage());
Thread.currentThread().interrupt();
}
return false;
}
Expand All @@ -102,6 +103,7 @@ public String getBridgeVersionFromVersionFile(String versionFilePath) {
}
} catch (IOException | InterruptedException e) {
logger.error("An exception occurred while extracting bridge-version from the 'versions.txt': " + e.getMessage());
Thread.currentThread().interrupt();
}
return null;
}
Expand Down Expand Up @@ -145,6 +147,7 @@ public String downloadVersionFileFromArtifactory(String directoryUrl) {
}
} catch (IOException | InterruptedException e) {
logger.error("An exception occurred while downloading 'versions.txt': " + e.getMessage());
Thread.currentThread().interrupt();
}
return tempVersionFilePath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public void installSynopsysBridge(FilePath bridgeZipPath, FilePath bridgeInstall
}
} catch (Exception e) {
logger.error("An exception occurred while unzipping Synopsys Bridge zip file: " + e.getMessage());
Thread.currentThread().interrupt();
}
}

Expand All @@ -56,6 +57,7 @@ public String defaultBridgeInstallationPath(FilePath workspace, TaskListener lis
defaultInstallationPath = workspace.act(new HomeDirectoryTask(separator));
} catch (IOException | InterruptedException e) {
logger.error(LogMessages.FAILED_TO_FETCH_PLUGINS_DEFAULT_INSTALLATION_PATH, e.getMessage());
Thread.currentThread().interrupt();
}

return defaultInstallationPath;
Expand All @@ -70,6 +72,7 @@ public void verifyAndCreateInstallationPath(String bridgeInstallationPath) {
}
} catch (IOException | InterruptedException e) {
logger.error("Failed to create directory: " + directory.getRemote());
Thread.currentThread().interrupt();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static String getAgentOs(FilePath workspace, TaskListener listener) {
os = workspace.act(new OsNameTask());
} catch (IOException | InterruptedException e) {
logger.error("An exception occurred while fetching the OS information for the agent node: " + e.getMessage());
Thread.currentThread().interrupt();
}
} else {
os = System.getProperty("os.name").toLowerCase();
Expand All @@ -60,6 +61,7 @@ public static void removeFile(String filePath, FilePath workspace, TaskListener
}
} catch (IOException | InterruptedException e) {
logger.error("An exception occurred while deleting file: " + e.getMessage());
Thread.currentThread().interrupt();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public String writeInputJsonToFile(String inputJson, String jsonPrefix) {
}
} catch (Exception e) {
logger.error("An exception occurred while writing into json file: " + e.getMessage());
Thread.currentThread().interrupt();
}

return inputJsonPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public boolean isValidInstallationPath(String installationPath) {
}
} catch (IOException | InterruptedException e) {
logger.error("An exception occurred while validating the installation path: " + e.getMessage());
Thread.currentThread().interrupt();
return false;

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void archiveDiagnostics(FilePath diagnosticsPath) {
}
} catch (Exception e) {
logger.error("An exception occurred while archiving diagnostics in jenkins artifact: " + e.getMessage());
Thread.currentThread().interrupt();
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public Bitbucket fetchBitbucketRepositoryDetails(Map<String, Object> scanParamet
bitbucketRepository = bitbucketApiFromSCMSource.getRepository();
} catch (Exception e) {
logger.error("An exception occurred while getting the BitbucketRepository from BitbucketApi: " + e.getMessage());
Thread.currentThread().interrupt();
}

String serverUrl = bitbucketSCMSource.getServerUrl();
Expand Down

0 comments on commit ee86f43

Please sign in to comment.