Refactor error handling #308

Merged
6543 merged 7 commits from noerw/tea:improve-error-log into master 2020-12-16 16:18:11 +00:00
Member
  • Use a single error handler instead of various log.Fatal() statements.
    (A few log.Fatal()s remain, as I only refactored things that don't require a change of function signature.)
  • Ensures that tea exits with non-zero exit status on error.
  • I also thought about introducing error codes for certain modules (API, git, ...) (this is supported by urfave/cli via the cli.ErrorCoder interface), but didn't continue as I wasn't sure what granularity would be needed to be useful, if useful at all. Let me know if you think this is worthwhile.

closes #295

- Use a single error handler instead of various `log.Fatal()` statements. (A few `log.Fatal()`s remain, as I only refactored things that don't require a change of function signature.) - Ensures that tea exits with non-zero exit status on error. - I also thought about introducing error codes for certain modules (API, git, ...) (this is supported by urfave/cli via the `cli.ErrorCoder` interface), but didn't continue as I wasn't sure what granularity would be needed to be useful, if useful at all. Let me know if you think this is worthwhile. closes #295
noerw added this to the v0.7.0 milestone 2020-12-15 22:12:43 +00:00
noerw added the
kind
refactor
label 2020-12-15 22:12:43 +00:00
noerw added 3 commits 2020-12-15 22:12:44 +00:00
6543 reviewed 2020-12-15 22:34:20 +00:00
Dismissed
main.go Outdated
@ -46,3 +46,3 @@
if err != nil {
log.Fatalf("Failed to run app with %s: %v", os.Args, err)
fmt.Printf("Error: %v\n", err)
}
Owner

One nit: can you print to stderr ?

One nit: can you print to stderr ?
noerw marked this conversation as resolved
noerw added 1 commit 2020-12-15 22:57:17 +00:00
Some checks reported errors
continuous-integration/drone/pr Build was killed
35b29b71f1
print to default err log
noerw added 1 commit 2020-12-15 22:57:37 +00:00
Some checks reported errors
continuous-integration/drone/pr Build was killed
edb1a8408f
cleanup
noerw added 1 commit 2020-12-15 22:59:00 +00:00
All checks were successful
continuous-integration/drone/pr Build is passing
d4a783216d
fix vet
lunny approved these changes 2020-12-16 11:34:04 +00:00
Dismissed
6543 added 1 commit 2020-12-16 16:12:33 +00:00
All checks were successful
continuous-integration/drone/pr Build is passing
c7bc79339e
Merge branch 'master' into improve-error-log
6543 approved these changes 2020-12-16 16:12:44 +00:00
Dismissed
6543 merged commit a948fd7e10 into master 2020-12-16 16:18:11 +00:00
6543 referenced this issue from a commit 2020-12-16 16:18:12 +00:00
Sign in to join this conversation.
No description provided.