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

Cleaner errors, implement output package. #29

Merged
merged 1 commit into from
Jan 14, 2017
Merged

Cleaner errors, implement output package. #29

merged 1 commit into from
Jan 14, 2017

Conversation

wjdp
Copy link
Owner

@wjdp wjdp commented Jan 11, 2017

  • Calls to package specific checkErr methods replaced with single CheckErrorPanic() method.
  • Addition of CheckErrorGeneric(), same as CheckErrorPanic but without the panic call, prints error and calls os.Exit(1).
  • Addition of AbortWith method, handles exiting nicely -- print red and exit with os.Exit(1). CheckErrorGeneric calls this.
  • Replacement of common errors (missing CLI args, missing config file) calling panic -> CheckErrorGeneric or AbortWith.
  • Will close CLI: Replace panic calls with more user friendly messages #17.

Example when calling program without path or config file.

~ ❯❯❯ htmltest
No path provided & .htmltest.yml does not exist.
See htmltest -h for usage.

Calls to package specific checkErr methods replaced with single
CheckErrorPanic() method.

Addition of CheckErrorGeneric(), same as CheckErrorPanic but without
the panic call, prints error and calls os.Exit(1).

Addition of AbortWith method, handles exiting nicely -- print red and
exit with os.Exit(1). CheckErrorGeneric calls this.

Replacement of common errors (missing CLI args, missing config file)
calling panic -> CheckErrorGeneric or AbortWith.

Will close #17.
@codecov-io
Copy link

codecov-io commented Jan 12, 2017

Current coverage is 95.03% (diff: 75.00%)

Merging #29 into master will increase coverage by 0.55%

@@             master        #29   diff @@
==========================================
  Files            16         16          
  Lines           833        826     -7   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits            787        785     -2   
+ Misses           33         30     -3   
+ Partials         13         11     -2   

Powered by Codecov. Last update 5d46939...39ba9c1

@wjdp wjdp merged commit 647a0ab into master Jan 14, 2017
@wjdp wjdp deleted the clean-errors branch January 14, 2017 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: Replace panic calls with more user friendly messages
2 participants