Skip to content

Commit

Permalink
log message when adding feature fails (#33151)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Nov 29, 2019
1 parent 7333ade commit 2734185
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/qgsvectorlayereditbuffer.cpp
Expand Up @@ -20,6 +20,8 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
#include "qgsvectorlayerutils.h"
#include "qgsmessagelog.h"


//! populate two lists (ks, vs) from map - in reverse order
template <class Key, class T> void mapToReversedLists( const QMap< Key, T > &map, QList<Key> &ks, QList<T> &vs )
Expand Down Expand Up @@ -119,7 +121,10 @@ bool QgsVectorLayerEditBuffer::addFeature( QgsFeature &f )
return false;
}
if ( L->mFields.count() != f.attributes().count() )
{
QgsMessageLog::logMessage( tr( "cannot add feature, wrong field count: layer: %1 feature: %2:" ).arg( L->mFields.count() ).arg( f.attributes().count() ) );
return false;
}

// TODO: check correct geometry type

Expand Down

0 comments on commit 2734185

Please sign in to comment.