Skip to content

Commit cdaf72e

Browse files
committed
fix: maxmind db loading error handling
1 parent b20ff79 commit cdaf72e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

maxmind/maxmind.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ func NewClient(asnDB string, countryDB string) (*Client, error) {
3636
}
3737

3838
countryReader, err := geoip2.FromBytes(countryData)
39-
return nil, fmt.Errorf("country geoip from bytes: %w", err)
39+
if err != nil {
40+
return nil, fmt.Errorf("country geoip from bytes: %w", err)
41+
}
42+
4043
return &Client{
4144
countryReader: countryReader,
4245
asnReader: asnReader,

0 commit comments

Comments
 (0)