Skip to content

Commit 9ce7a2e

Browse files
committed
Fixing catch block
1 parent 79c79df commit 9ce7a2e

File tree

1 file changed

+4
-4
lines changed
  • plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/artifacts

1 file changed

+4
-4
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/artifacts/ArtifactHelper.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ class ArtifactHelper(private val lspArtifactsPath: Path = DEFAULT_ARTIFACT_PATH,
126126
}
127127
}
128128
return downloadPath
129-
} catch (e: CancellationException) {
130-
logger.error(e) { "User cancelled download and extracting of LSP artifacts.." } // fallback to older version of LSP artifacts if available.
131129
} catch (e: Exception) {
132-
logger.error(e) { "Failed to download/move LSP artifacts on attempt ${currentAttempt.get()}" }
133-
} finally {
130+
when (e) {
131+
is CancellationException -> { logger.error(e) { "User cancelled download and extracting of LSP artifacts.." } }
132+
else -> { logger.error(e) { "Failed to download/move LSP artifacts on attempt ${currentAttempt.get()}" } }
133+
}
134134
temporaryDownloadPath.toFile().deleteRecursively()
135135
downloadPath.toFile().deleteRecursively()
136136
}

0 commit comments

Comments
 (0)