0 in case of success, 1 if selected feature is not multipart, 2 if ring is not a valid geometry, 3 if new polygon ring not disjoint with existing rings, 4 if no feature was selected, 5 if several features are selected, 6 if selected geometry not found

Returns the result of the attempt. If a commit fails, the in-memory changes are left alone.

This allows editing to continue if the commit failed on e.g. a disallowed value in a Postgres database - the user can re-edit and try again.

The commits occur in distinct stages, (add attributes, add features, change attribute values, change geometries, delete features, delete attributes) so if a stage fails, it's difficult to roll back cleanly. Therefore any error message also includes which stage failed so that the user has some chance of repairing the damage cleanly.