diff options
author | siddharth <s@ricketyspace.net> | 2022-05-15 23:24:51 -0400 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2022-05-15 23:25:19 -0400 |
commit | ceb8a50a802f3499a9e4a38940d7c001ce7d0004 (patch) | |
tree | 0ad5766e2e4de9a365f644e96945619df84e034c /nws | |
parent | 52b2555773473a3bbc0abe05ec2c8c61ad93a353 (diff) |
nws: update Points
update error messages.
Diffstat (limited to 'nws')
-rw-r--r-- | nws/nws.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -46,7 +46,7 @@ func Points(lat, lng float32) (*NWSPoint, error) { // Parse response body. body, err := io.ReadAll(resp.Body) if err != nil { - return nil, fmt.Errorf("getting points: body: %v", err) + return nil, fmt.Errorf("points: body: %v", err) } // Check if the request failed. @@ -63,13 +63,13 @@ func Points(lat, lng float32) (*NWSPoint, error) { point := new(NWSPoint) err = json.Unmarshal(body, point) if err != nil { - return nil, fmt.Errorf("points: json decode: %v", err) + return nil, fmt.Errorf("points: decode: %v", err) } if point.Properties.Forecast == "" { - return nil, fmt.Errorf("points: json: forecast empty") + return nil, fmt.Errorf("points: forecast empty") } if point.Properties.ForecastHourly == "" { - return nil, fmt.Errorf("points: json: forecasthourly empty") + return nil, fmt.Errorf("points: forecasthourly empty") } return point, nil } |