aws-amplify / aws-amplify/amplify-cli

consolidate messaging when exiting (ctrl+c) out of an `add <category>` flow

Open
#11,096 1 comment 0 reactions 0 assignees View on GitHub
bug p2 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

pnpm

### If applicable, what version of Node.js are you using?

v18.7.0

### Amplify CLI Version

10.0.0

### What operating system are you using?

mac

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

n/a

### Amplify Categories

Not applicable

### Amplify Commands

Not applicable

### Describe the bug

When exiting out of `add ` flows using ctrl+c, the Amplify CLI presents different behaviors between the categories. Some are logging an error and some simply exit

```
aws-amplify/reproductions/8441
➜ amplify add storage
? Select from one of the below mentioned services: (Use arrow keys)
❯ Content (Images, audio, video, etc.)
NoSQL Database

aws-amplify/reproductions/8441
➜ amplify add storage
✖ Provide a friendly name for your resource that will be used to label this category in the project: · s3b84fc593
🛑 An error occurred when adding the storage resource

aws-amplify/reproductions/8441
➜ amplify add api
✖ Provide a friendly name for your resource to be used as a label for this category in the project: · api844118b0
🛑 There was an error adding the API resource

aws-amplify/reproductions/8441
➜ amplify add notifications
? Choose the push notification channel to enable. APNS

An Amazon Pinpoint project will be created for notifications.
? Provide your pinpoint resource name: (8441RLxis)

aws-amplify/reproductions/8441
➜ amplify add auth
Using service: Cognito, provided by: awscloudformation

The current configured provider is Amazon Cognito.

Do you want to use the default authentication and security configuration? Default configuration
Warning: you will not be able to edit these selections.
How do you want users to be able to sign in? (Use arrow keys)
❯ Username
Email
Phone Number
Email or Phone Number
I want to learn more.

aws-amplify/reproductions/8441
➜ amplify add function
? Select which capability you want to add: (Use arrow keys)
❯ Lambda function (serverless function)
Lambda layer (shared code & resource used across functions)
```

### Expected behavior

either

- if in favor of error messages, consolidate messaging (e.g. "An error occurred when adding the storage resource" vs "There was an error adding the API resource")
- remove error messages

### Reproduction steps

1. `amplify init -y`
2. `amplify add storage`
3. select "Content..." for S3
4. exit/ctrl+c from flow

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Project Identifier

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

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.