Skip to content

Conversation

@akhamis-amzn
Copy link
Contributor

Problem
FileCreationFailed exceptions are displayed as UnknownException in telemetry. This exception is new and we want to separate this out from other unknown exceptions.

Solution
Return API service error with FileCreationFailedException

Types of changes

  • Bug fix (non-breaking change which fixes an issue) -- not really a bug fix but this is just adding some data for telemetry
  • New feature (non-breaking change which adds functionality)

Description

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes -- not needed + no existing tests for these messages
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@akhamis-amzn akhamis-amzn requested a review from a team as a code owner May 8, 2025 18:38
@akhamis-amzn akhamis-amzn force-pushed the add-file-creation-error branch from 6a3560a to 6002f9b Compare May 9, 2025 13:46
ClientException(message("amazonqFeatureDev.exception.prompt_refusal"), operation, desc, cause)

class FileCreationFailedException(operation: String, desc: String?, cause: Throwable? = null) :
ServiceException(message("amazonqFeatureDev.exception.failed_generation"), operation, desc, cause)

Check failure

Code scanning / QDJVMC

Invalid property key Error

'amazonqFeatureDev.exception.failed_generation' doesn't appear to be a valid property key
ClientException(message("amazonqFeatureDev.exception.prompt_refusal"), operation, desc, cause)

class FileCreationFailedException(operation: String, desc: String?, cause: Throwable? = null) :
ServiceException(message("amazonqFeatureDev.exception.failed_generation"), operation, desc, cause)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment below is likely correct. Is there a definition for amazonqFeatureDev.exception.failed_generation in the strings file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified offline that it does exist

ClientException(message("amazonqFeatureDev.exception.prompt_refusal"), operation, desc, cause)

class FileCreationFailedException(operation: String, desc: String?, cause: Throwable? = null) :
ServiceException(message("amazonqFeatureDev.exception.failed_generation"), operation, desc, cause)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified offline that it does exist

@akhamis-amzn akhamis-amzn merged commit 24e7749 into aws:main May 9, 2025
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants