{{{
from django.contrib.gis.geos import GEOSGeometry, GEOSException
import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
try:
GEOSGeometry("POLYGON ((20 30, 35 35, 30 20))")
except GEOSException:
pass
}}}
This will display the following error message:
`2020-12-09 10:03 ERROR GEOS_ERROR: IllegalArgumentException: Points of
LinearRing do not form a closed linestring`
It seems that the logging happens here:
https://github.com/django/django/blob/2c5d6dc44779448de1497f32c925c96975fae461/django/contrib/gis/geos/libgeos.py#L99
--
Ticket URL: <https://code.djangoproject.com/ticket/32251>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
These errors are logged before exceptions are caught. It's not feasible to
recognize in Django that they're handled in you app. You can try to add
your own filter to the logger.
--
Ticket URL: <https://code.djangoproject.com/ticket/32251#comment:1>
Comment (by Mariusz Felisiak):
See [https://docs.djangoproject.com/en/3.1/topics/logging/#id5 docs].
--
Ticket URL: <https://code.djangoproject.com/ticket/32251#comment:2>