aws-cloudformation / aws-cloudformation/cloudformation-cli-java-plugin

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

Open
#351 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
30
Forks
48
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.