Jump to conversation
Unresolved conversations (0)
Nice work!

Nice work!

All of your conversations have been resolved.

Resolved conversations (16)
@snowman2 snowman2 Jan 3, 2024
```suggestion cdef dict _CODE_MAP = { ```
Outdated
rasterio/_err.pyx
@snowman2 snowman2 Jan 3, 2024
```suggestion cdef dict _LEVEL_MAP = { ```
Outdated
rasterio/_err.pyx
@snowman2 snowman2 Jan 3, 2024
```suggestion _ERROR_STACK = ContextVar("error_stack") ```
Outdated
rasterio/_err.pyx
@sgillies sgillies Jan 3, 2024
`StackChecker` takes on all the eliminated code.
Outdated
rasterio/_err.pyx
@sgillies sgillies Jan 3, 2024
The handler looks up the thread local chained error stack, no need to pass a pointer to data.
rasterio/_err.pyx
@sgillies sgillies Jan 3, 2024
`StackChecker` provides some familiar error checking/raising functionality, but in the context of our new Python chained error stack instead of GDAL's error stack.
rasterio/_err.pyx
@sgillies sgillies Jan 3, 2024
New code does nothing in the debug or warning cases. Only if we have a class 3 error.
Outdated
rasterio/_err.pyx
@sgillies sgillies Jan 3, 2024
`noexcept` prevents Cython compiler warnings.
rasterio/_env.pyx
@sgillies sgillies Jan 2, 2024
No more cramming the causing error message into the raised error message.
Outdated
rasterio/_io.pyx
@rouault rouault Jul 16, 2022
testing exact error messages looks fragile to me. You could potentially just test they are not empty and different between that instance and the one 3 lines below
Outdated
tests/test_read.py
@sgillies sgillies Jul 15, 2022
A new test which asserts that the existing behavior on trying to read imagery from a busted GeoTIFF is preserved, and also that we can, by traversing to context and cause, get the root error.
Outdated
tests/test_read.py
sgillies
@sgillies sgillies Jul 15, 2022
Inside the `with` block `chaining_error_handler` can be appending objects to `error_stack`.
Outdated
rasterio/_err.pyx
@sgillies sgillies Jul 15, 2022
This context manager is used like ```python try: with stack_errors(): GDALOpenDatasetEx(...) except CPLE_BaseError as cplerr: raise RasterioError("oh no") from cplerr ```
Outdated
rasterio/_err.pyx
sgillies
@sgillies sgillies Jul 15, 2022
And append the exception form of a GDAL error to it.
Outdated
rasterio/_err.pyx
@sgillies sgillies Jul 15, 2022
Here we get that Python list from the GDAL error context.
Outdated
rasterio/_err.pyx
@sgillies sgillies Jul 15, 2022
The code that adds this handler also passes a pointer to a Python list to the GDAL error context.
Outdated
rasterio/_err.pyx