简体   繁体   中英

Geoserver and Openlayers - Show detailed message error in WFS-T

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, ie 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?

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.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM