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

Tasit-Action config file errors handling and path #103

Open
marcelomorgado opened this issue Jan 14, 2019 · 1 comment
Open

Tasit-Action config file errors handling and path #103

marcelomorgado opened this issue Jan 14, 2019 · 1 comment
Labels
action tasit-action child package enhancement New feature or request good first issue Good for newcomers tech debt Technical debt not involving bugs or features
Milestone

Comments

@marcelomorgado
Copy link
Contributor

Improve config file errors and warnings on these cases:

1. Config file not found
Throw error but keep an option open for the user to use the default as simply as possible.

2. Config w/ missing parts (e.g. jsonrpc provider without connections params)
Throw error and log exactly what is missing and suggest defaults in the log statements. The more lines we have const { bla } = blaBla followed by

if (!bla) {
  console.log("bla is needed to do foo because bar, but it's missing")
}

the better.

3. Error on parsing config file
Throwing and error and logging as best we can in which step the parsing failed. The more lines we have like this, the better:

try {
  jsonObject = JSON.parse(jsonString)
} catch (error) {
  if (error.message === "something") // or more likely, whether it contains a word
    console.log("This is why it failed")
  }
}

Related to: #87 (comment)

@marcelomorgado marcelomorgado added enhancement New feature or request tech debt Technical debt not involving bugs or features good first issue Good for newcomers labels Jan 14, 2019
@pcowgill pcowgill added this to the 0.2.0 release milestone Jan 14, 2019
@marcelomorgado marcelomorgado changed the title Tasit-Action config file errors handling Tasit-Action config file errors handling and path Jan 15, 2019
@marcelomorgado
Copy link
Contributor Author

marcelomorgado commented Jan 15, 2019

4. Rename folder name from config to .confg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action tasit-action child package enhancement New feature or request good first issue Good for newcomers tech debt Technical debt not involving bugs or features
Projects
None yet
Development

No branches or pull requests

2 participants