apache / apache/pulsar-client-go
Fatal on error
- Dominant language
- Go
- Stars
- 745
- Forks
- 389
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 3
Description
I see library does `log.fatal` some places which causes app to terminate.
example 👇
https://github.com/apache/pulsar-client-go/blob/master/pulsar/schema.go#L99
https://github.com/apache/pulsar-client-go/blob/master/pulsar/schema.go#L134
https://github.com/apache/pulsar-client-go/blob/master/pulsar/schema.go#L170
I'm not sure if I'm correct, but In general libraries should not cause the app to terminate. I think that's a decision for the app writer, not the library, to make.
So instead of fatal, why not just return the `error`.
Contributor guide
Research direction
Start with the three referenced locations in pulsar/schema.go at lines 99, 134, and 170, then trace how their callers handle failures. Determine the affected public return paths and check existing tests for schema errors. Done means library errors reach the application without terminating it, with relevant behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100