Skip to content

Commit fd95bc1

Browse files
dhasani23David Hasani
and
David Hasani
authored
fix(amazonq): show correct error message (#5335)
* fix(amazonq): show correct error message * fix lint --------- Co-authored-by: David Hasani <davhasan@amazon.com>
1 parent db2e39f commit fd95bc1

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/constants/CodeTransformChatItems.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,11 @@ fun buildLanguageUpgradeProjectValidChatContent() = CodeTransformChatMessageCont
284284

285285
fun buildProjectInvalidChatContent(validationResult: ValidationResult): CodeTransformChatMessageContent {
286286
val errorMessage = when (validationResult.invalidTelemetryReason.category) {
287-
CodeTransformPreValidationError.NoPom -> message("codemodernizer.chat.message.validation.error.no_pom", CODE_TRANSFORM_PREREQUISITES)
288-
CodeTransformPreValidationError.UnsupportedJavaVersion -> message("codemodernizer.chat.message.validation.error.unsupported_java_version")
287+
CodeTransformPreValidationError.UnsupportedJavaVersion, CodeTransformPreValidationError.UnsupportedBuildSystem ->
288+
message("codemodernizer.chat.message.validation.error.unsupported_module")
289289
CodeTransformPreValidationError.RemoteRunProject -> message("codemodernizer.notification.warn.invalid_project.description.reason.remote_backend")
290290
CodeTransformPreValidationError.NonSsoLogin -> message("codemodernizer.notification.warn.invalid_project.description.reason.not_logged_in")
291291
CodeTransformPreValidationError.EmptyProject -> message("codemodernizer.notification.warn.invalid_project.description.reason.missing_content_roots")
292-
CodeTransformPreValidationError.UnsupportedBuildSystem -> message("codemodernizer.chat.message.validation.error.no_pom")
293292
CodeTransformPreValidationError.NoJavaProject -> message("codemodernizer.chat.message.validation.error.no_java_project")
294293
CodeTransformPreValidationError.JavaDowngradeAttempt -> message("codemodernizer.chat.message.validation.error.downgrade_attempt")
295294
else -> message("codemodernizer.chat.message.validation.error.other")

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,8 @@ codemodernizer.chat.message.validation.error.invalid_target_db=I can only conver
703703
codemodernizer.chat.message.validation.error.missing_sct_file=An .sct file is required for transformation. Make sure that you've uploaded the .zip file you retrieved from your schema conversion in AWS DMS.
704704
codemodernizer.chat.message.validation.error.more_info=For more information, see the [Amazon Q documentation]({0}).
705705
codemodernizer.chat.message.validation.error.no_java_project=Sorry, I could not find an open Java module with embedded Oracle SQL statements. Make sure you have a Java module open that has at least 1 content root.
706-
codemodernizer.chat.message.validation.error.no_pom=I couldn't find a module that I can upgrade. Your Java project must be built on Maven and contain a pom.xml file. For more information, see the [Amazon Q documentation]({0}).
707706
codemodernizer.chat.message.validation.error.other=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, Java 17, and Java 21 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, Java 17, or Java 21 module in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
708-
codemodernizer.chat.message.validation.error.unsupported_java_version=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, Java 17, and Java 21 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, Java 17, or Java 21 in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
707+
codemodernizer.chat.message.validation.error.unsupported_module=I couldn't find a module that I can upgrade. Currently, I support Java 8, Java 11, Java 17, and Java 21 projects built on Maven. Make sure your project is open in the IDE. If you have a Java 8, Java 11, Java 17, or Java 21 in your workspace, you might need to configure your project so that I can find it. Go to File and choose Project Structure. In the Projects tab, set the correct project JDK and the correct language level. In the Modules tab, set the correct module JDK and language level.
709708
codemodernizer.chat.message.validation.no_jdk=I couldn't build your project with your current JDK configuration. To update your JDK, go to File and choose Project Structure. In the Projects tab, set the correct project JDK in the SDK field. In the Modules tab, set the correct module JDK in the SDK field. In Maven Runner settings, set the correct JDK in the JRE field.
710709
codemodernizer.chat.prompt.label.dependency_current_version=Current version
711710
codemodernizer.chat.prompt.label.dependency_name=Dependency name

0 commit comments

Comments
 (0)