base16-universal-manager icon indicating copy to clipboard operation
base16-universal-manager copied to clipboard

Handle errors properly

Open pinpox opened this issue 6 years ago • 1 comments

We should not always just panic

pinpox avatar Dec 08 '18 09:12 pinpox

For example, when misspelling the enabled property value as "ture" instead of "true", I get a stack trace:

panic: yaml: unmarshal errors:
  line 209: cannot unmarshal !!str `ture` into bool

goroutine 1 [running]:
main.check(...)
	/home/ldh/.local/lib/go/src/github.com/binaryplease/base16-universal-manager/main.go:144
main.NewConfig(0xc00001e300, 0x36, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/ldh/.local/lib/go/src/github.com/binaryplease/base16-universal-manager/config.go:48 +0x3f7
main.main()
	/home/ldh/.local/lib/go/src/github.com/binaryplease/base16-universal-manager/main.go:35 +0x78

lhanson avatar Nov 27 '19 00:11 lhanson