michiwend / gomusicbrainz

a Go (Golang) MusicBrainz WS2 client library - work in progress
MIT License
57 stars 24 forks source link

Library doesn't allow for handling connection errors #8

Closed serejja closed 7 years ago

serejja commented 7 years ago

Hi! I'm starting to use gomusicbrainz in my project and encountered a quite simple but annoying issue - there are 2 cases that call log.Fatalln(err) (namely https://github.com/michiwend/gomusicbrainz/blob/master/gomusicbrainz.go#L140 and https://github.com/michiwend/gomusicbrainz/blob/master/gomusicbrainz.go#L147), and thus don't give any chance to handle these errors.

Is there any reason to consider these errors really fatal? Looks like simple return err should be enough here.

michiwend commented 7 years ago

Hi @serejja

yeah you are right, it'd be better to return these errors. I already saw your pr, will merge it. Thx for contributing!