Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message - Concerto CLI #151

Closed
4katie opened this issue Oct 29, 2019 · 1 comment
Closed

Confusing error message - Concerto CLI #151

4katie opened this issue Oct 29, 2019 · 1 comment
Assignees
Labels
Type: Enhancement ✨ Improvement to process or efficiency

Comments

@4katie
Copy link

4katie commented Oct 29, 2019

Is your feature request related to a problem? Please describe.
The error message that appears when I enter incorrect commands are confusing and quite generic.

hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty$ concerto validate 
15:13:21 - error: ENOENT: no such file or directory, open 'sample.json'

hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty$ concerto compile
15:13:29 - error: EISDIR: illegal operation on a directory, read

hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty$ concerto get
15:13:32 - error: EISDIR: illegal operation on a directory, read

hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty/models$ concerto compile clause.cto --target Go
15:13:41 - error: EISDIR: illegal operation on a directory, read

Describe the solution you'd like
More informative error messages.

For example, this error message (when I used a wrong .json file) was quite helpful:

hyewon@hobbang:~/Accord_Project/cicero-template-library/src/latedeliveryandpenalty$ concerto validate --sample package.json --ctoFiles models/clause.cto
15:10:08 - error: Invalid JSON data. Does not contain a $class type identifier.

For the code snippet above, for example concerto compile clause.cto --target Go, an error message could be something like:

error: target CTO file unclear. 
Try including --ctoFiles in front of the target CTO files you want to convert

or a more generic, but more specific, error message (compared to EISDIR) would be:

error: cannot find command arguments. 
Try using `concerto compile --ctoFiles <filename> --target <targetFormat>`

Describe alternatives you've considered
N/A

Additional context
concerto version 0.82.4

@jeromesimeon jeromesimeon added the Type: Enhancement ✨ Improvement to process or efficiency label Oct 31, 2019
@jeromesimeon jeromesimeon self-assigned this Nov 11, 2019
@jeromesimeon
Copy link
Member

With upcoming PR in #155

bash-3.2$ ~/git/concerto/packages/concerto-cli/index.js get 
concerto get

save local copies of external model dependencies

Options:
  --version      Show version number                                   [boolean]
  --verbose, -v                                                 [default: false]
  --help         Show help                                             [boolean]
  --ctoFiles     array of local CTO files                     [array] [required]
  --ctoSystem    system model to be used                                [string]
  --output       output directory path                  [string] [default: "./"]

Missing required argument: ctoFiles
Please provide at least the CTO files
bash-3.2$ ~/git/concerto/packages/concerto-cli/index.js validate 
13:46:39 - info: Loading a default sample.json file.
13:46:39 - error: A sample.json file is required. Try the --sample flag or create a sample.json file.
bash-3.2$ ~/git/concerto/packages/concerto-cli/index.js compile
concerto compile

generate code for a target platform

Options:
  --version      Show version number                                   [boolean]
  --verbose, -v                                                 [default: false]
  --help         Show help                                             [boolean]
  --ctoSystem    system model to be used                                [string]
  --ctoFiles     array of CTO files                           [array] [required]
  --target       target of the code generation  [string] [default: "JSONSchema"]
  --output       output directory path           [string] [default: "./output/"]

Missing required argument: ctoFiles
Please provide at least the CTO files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement ✨ Improvement to process or efficiency
Projects
None yet
Development

No branches or pull requests

2 participants