Commit 5d74ca5
committed
Fix: Add error handling for missing 'tiles' key in stac_tile response
When TiTiler endpoint returns an error response (e.g., validation errors),
the response doesn't contain a 'tiles' key, causing a KeyError.
This fix:
- Checks if 'tiles' exists in the response before accessing it
- Provides informative error messages based on the API error response
- Handles both dict-based errors (with 'detail' key) and list-based
validation errors
- Raises ValueError with descriptive message instead of bare KeyError
Fixes opengeos/geoai#4681 parent cf92c4e commit 5d74ca5
1 file changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
853 | 873 | | |
854 | 874 | | |
855 | 875 | | |
| |||
0 commit comments