From 2a56144bbc82305fd5b8cd6ec7dc3b4c70798397 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sat, 10 Aug 2024 03:21:16 +0200 Subject: [PATCH] Enhance npm cache clean error handling in Jenkinsfile Wrapped npm cache clean command in a try-catch block to improve error handling. This ensures that the build process can proceed even if the npm cache clean step fails. Added an informational echo message for better diagnostics in case of failure. --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 137d2ea..fb410a0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,11 @@ pipeline { def success = false // Clean npm cache and try normal install and npm ci once - sh 'npm cache clean --force' + try { + sh 'npm cache clean --force' + } catch (Exception e0) { + echo 'npm cache clean --force failed trying more things' + } try { sh 'npm install' success = true