adobe / adobe/aio-cli

Cryptic error message - uncaught error condition

Aperta
#331 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
95
Fork
45
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Expected Behaviour

When error condition exists, the cli politely informs the user what was wrong with their command

### Actual Behaviour

developer needs a degree in crypto-zoology to figure out where the error is coming from

### Reproduce Scenario (including but not limited to)

I have no idea how the user arrived at this state, but it IS possible that our template tooling produced an app config that was not valid. Most likely this was the result of an attempt to change an existing app from the old structure to the new structure.

#### Steps to Reproduce

1. add the sample code listed below
2. run any command that reads app config ex. `aio app info`

#### Environment Info
```
System:
OS: macOS 11.6
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 21.37 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.0 - ~/.nvm/versions/node/v14.18.0/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.15 - ~/.nvm/versions/node/v14.18.0/bin/npm
Virtualization:
Docker: 20.10.8 - /usr/local/bin/docker
npmGlobalPackages:
@adobe/aio-cli: 8.2.0
```
#### Sample Code that illustrates the problem

##### app.config.yaml
```yml
hooks:
test: "jest --passWithNoTests ./test",
e2e: "jest --collectCoverage=false --testRegex ./e2e"
```

#### Logs taken while reproducing problem
```bash
✗ aio app info
› Error: bad indentation of a mapping entry at line 45, column 52:
› ... "jest --passWithNoTests ./test",

```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il malfunzionamento con l’app.config.yaml fornito e il comando `aio app info`. Traccia il punto in cui viene segnalato l’errore di parsing YAML, quindi fai in modo che la CLI identifichi chiaramente la configurazione non valida e la sua posizione; il lavoro è completato quando questo scenario produce un messaggio utile invece del criptico errore non gestito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.