Skip to content

Commit

Permalink
log error when fetching tile from missing archive [#122]
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Jan 29, 2024
1 parent 456d7b9 commit 92a2f29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pmtiles/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,10 @@ func (server *Server) getTile(ctx context.Context, httpHeaders map[string]string

if entry.RunLength > 0 {
r, err := server.bucket.NewRangeReader(ctx, name+".pmtiles", int64(header.TileDataOffset+entry.Offset), int64(entry.Length))
// possible we have the header/directory cached but the archive has disappeared
if err != nil {
return 500, httpHeaders, []byte("Network error")
server.logger.Printf("failed to fetch tile %s %d-%d", name, entry.offset, entry.length)

Check failure on line 344 in pmtiles/server.go

View workflow job for this annotation

GitHub Actions / fmt_vet_lint

entry.offset undefined (type EntryV3 has no field or method offset, but does have Offset)

Check failure on line 344 in pmtiles/server.go

View workflow job for this annotation

GitHub Actions / fmt_vet_lint

entry.length undefined (type EntryV3 has no field or method length, but does have Length)

Check failure on line 344 in pmtiles/server.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

entry.offset undefined (type EntryV3 has no field or method offset, but does have Offset)

Check failure on line 344 in pmtiles/server.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

entry.length undefined (type EntryV3 has no field or method length, but does have Length)
return 404, httpHeaders, []byte("archive not found")
}
defer r.Close()
b, err := io.ReadAll(r)
Expand Down

0 comments on commit 92a2f29

Please sign in to comment.