Exception details are lost when constructor with operation name is used.

Open
#351 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Start by tracing the constructors of CfnGeneralServiceException and the path that creates CfnInternalFailureException when exceptions are unhandled. Verify the operation-name constructor and the internal-failure path against the examples in the issue; done means the original exception message is retained in both CloudFormation error messages.

Written by the indexing model from the issue text.

Description

bug

When the exception is thrown with operation name the original errorMessage is lost.
For example

throw new CfnGeneralServiceException("Operation", new RuntimeException("something happend");

results in "Error occurred during operation 'Operation'." message.

If operation parameter would not be passed

throw new CfnGeneralServiceException(new RuntimeException("something happend")

then the message would contain "something happend".

There are existing implementation's of resources that rethrow exceptions with operation field set, and the original message is thrown. What is more - if any exception will be unhandled explicitly CfnInternalFailureException will be thrown without errorMessage from the original exception and CloudFormation console will just display "Internal failure... " kind of message

Dominant language
Java
Stars
30
Forks
48
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws-cloudformation/cloudformation-cli-java-plugin

All issues in aws-cloudformation/cloudformation-cli-java-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.