error handling in WFSDescribeFeatureType format

This commit is contained in:
Bart van den Eijnden
2012-03-30 23:04:03 +02:00
parent 9a5364f309
commit 2e83863e90
2 changed files with 23 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
/**
* @requires OpenLayers/Format/XML.js
* @requires OpenLayers/Format/OGCExceptionReport.js
*/
/**
@@ -188,7 +189,11 @@ OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class(
}
var schema = {};
this.readNode(data, schema);
if (schema.version === undefined) {
// an exception must have occurred, so parse it
var parser = new OpenLayers.Format.OGCExceptionReport();
schema.error = parser.read(data);
}
return schema;
},