0
votes

I have followed this example to save/edit elements in a openlayers map with geoserver

The geoserver layers are connected to a postgres database with postgis; in postgis I added certain constraints about inserting new records, i.e. two polygons cannot touch each other/cannot contain another polygon

How can I show with openlayers those constraint errors? with a WFS-T insert request, I just get this message:

<ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows http://myserver:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd">
    <ows:Exception exceptionCode="InvalidParameterValue">
        <ows:ExceptionText>Update error: Error occured updating features</ows:ExceptionText>
    </ows:Exception>
</ows:ExceptionReport>

I can get the entire stacktrace in geoserver and make sure what constraint was triggered, is there a way to obtain more detail with openlayers?

1

1 Answers

0
votes

In the global settings page you can check the box that says include stack trace in service exception to provide a stack trace in the XML returned to OpenLayers.

enter image description here