Merge pull request #378 from bartvde/wfsdft
error handling in WFSDescribeFeatureType format (r=@ahocevar,elemoine)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Format/XML.js
|
||||
* @requires OpenLayers/Format/OGCExceptionReport.js
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -187,8 +188,13 @@ OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class(
|
||||
data = data.documentElement;
|
||||
}
|
||||
var schema = {};
|
||||
this.readNode(data, schema);
|
||||
|
||||
if (data.nodeName.split(":").pop() === 'ExceptionReport') {
|
||||
// an exception must have occurred, so parse it
|
||||
var parser = new OpenLayers.Format.OGCExceptionReport();
|
||||
schema.error = parser.read(data);
|
||||
} else {
|
||||
this.readNode(data, schema);
|
||||
}
|
||||
return schema;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user