Skip to content

Commit

Permalink
fix(amazonq): show correct error message (#5335)
Browse files Browse the repository at this point in the history
* fix(amazonq): show correct error message

* fix lint

---------

Co-authored-by: David Hasani <[email protected]>
  • Loading branch information
dhasani23 and David Hasani authored Feb 8, 2025
1 parent db2e39f commit fd95bc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,11 @@ fun buildLanguageUpgradeProjectValidChatContent() = CodeTransformChatMessageCont

fun buildProjectInvalidChatContent(validationResult: ValidationResult): CodeTransformChatMessageContent {
val errorMessage = when (validationResult.invalidTelemetryReason.category) {
CodeTransformPreValidationError.NoPom -> message("codemodernizer.chat.message.validation.error.no_pom", CODE_TRANSFORM_PREREQUISITES)
CodeTransformPreValidationError.UnsupportedJavaVersion -> message("codemodernizer.chat.message.validation.error.unsupported_java_version")
CodeTransformPreValidationError.UnsupportedJavaVersion, CodeTransformPreValidationError.UnsupportedBuildSystem ->
message("codemodernizer.chat.message.validation.error.unsupported_module")
CodeTransformPreValidationError.RemoteRunProject -> message("codemodernizer.notification.warn.invalid_project.description.reason.remote_backend")
CodeTransformPreValidationError.NonSsoLogin -> message("codemodernizer.notification.warn.invalid_project.description.reason.not_logged_in")
CodeTransformPreValidationError.EmptyProject -> message("codemodernizer.notification.warn.invalid_project.description.reason.missing_content_roots")
CodeTransformPreValidationError.UnsupportedBuildSystem -> message("codemodernizer.chat.message.validation.error.no_pom")
CodeTransformPreValidationError.NoJavaProject -> message("codemodernizer.chat.message.validation.error.no_java_project")
CodeTransformPreValidationError.JavaDowngradeAttempt -> message("codemodernizer.chat.message.validation.error.downgrade_attempt")
else -> message("codemodernizer.chat.message.validation.error.other")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,8 @@ codemodernizer.chat.message.validation.error.invalid_target_db=I can only conver
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.
codemodernizer.chat.message.validation.error.more_info=For more information, see the [Amazon Q documentation]({0}).
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.
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}).
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.
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.
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.
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.
codemodernizer.chat.prompt.label.dependency_current_version=Current version
codemodernizer.chat.prompt.label.dependency_name=Dependency name
Expand Down

0 comments on commit fd95bc1

Please sign in to comment.