Skip to content

Commit 52dbe48

Browse files
authored
Fix exception message for unresolved exectuables (#3018)
1 parent f7bcf9a commit 52dbe48

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

jetbrains-core/src/software/aws/toolkits/jetbrains/core/executables/ExecutableManager.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ class DefaultExecutableManager : PersistentStateComponent<ExecutableStateList>,
9292
LOG.warn(it) { "Error thrown while updating executable cache" }
9393
null
9494
}
95-
return ExecutableInstance.UnresolvedExecutable(message("executableCommon.missing_executable", type.displayName))
95+
return ExecutableInstance.UnresolvedExecutable(
96+
message("executableCommon.missing_executable", type.displayName, message("executableCommon.not_installed"))
97+
)
9698
}
9799

98100
// Check if the set executable was modified. If it was, start an update in the background. Overlapping
@@ -177,7 +179,9 @@ class DefaultExecutableManager : PersistentStateComponent<ExecutableStateList>,
177179

178180
private fun resolve(type: ExecutableType<*>): ExecutableInstance = try {
179181
(type as? AutoResolvable)?.resolve()?.let { validateAndSave(type, it, autoResolved = true) }
180-
?: ExecutableInstance.UnresolvedExecutable(message("executableCommon.missing_executable", type.displayName))
182+
?: ExecutableInstance.UnresolvedExecutable(
183+
message("executableCommon.missing_executable", type.displayName, message("executableCommon.not_installed"))
184+
)
181185
} catch (e: Exception) {
182186
ExecutableInstance.UnresolvedExecutable(message("aws.settings.executables.resolution_exception", type.displayName, e.asString))
183187
}

jetbrains-core/tst/software/aws/toolkits/jetbrains/services/lambda/execution/local/LocalLambdaRunConfigurationTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class LocalLambdaRunConfigurationTest {
207207
assertThat(runConfiguration).isNotNull
208208
assertThatThrownBy { runConfiguration.checkConfiguration() }
209209
.isInstanceOf(RuntimeConfigurationError::class.java)
210-
.hasMessage(message("executableCommon.missing_executable", "sam"))
210+
.hasMessage(message("executableCommon.missing_executable", "sam", message("executableCommon.not_installed")))
211211
}
212212
}
213213

resources/resources/software/aws/toolkits/resources/MessagesBundle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ executableCommon.empty_info={0} did not provide any output
574574
executableCommon.failed_install=Failed to install {0}
575575
executableCommon.installing=Installing {0}
576576
executableCommon.latest_not_compatible=Latest version of {0} is not compatible with the toolkit''s supported range: {1}
577-
executableCommon.missing_executable=Validation of {0} failed.\n{1}
577+
executableCommon.missing_executable=Validation of {0} failed: {1}
578578
executableCommon.not_installed=Not installed.
579579
executableCommon.unexpected_output={0} provided unexpected output. Ensure that your {0} is up-to-date: "{1}"
580580
executableCommon.updating=Updating {0}

0 commit comments

Comments
 (0)