changeset 1828:1ecfcf46e4da

Waterway area/axis: Be more informative if features are bad.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 16 Jan 2019 15:35:23 +0100
parents 27c4effba5b1
children b4b9089c2d79
files pkg/imports/wa.go pkg/imports/wx.go
diffstat 2 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/wa.go	Wed Jan 16 15:29:41 2019 +0100
+++ b/pkg/imports/wa.go	Wed Jan 16 15:35:23 2019 +0100
@@ -255,12 +255,6 @@
 		return nil, err
 	}
 
-	if features == 0 {
-		err := errors.New("No features found")
-		feedback.Error("%v", err)
-		return nil, err
-	}
-
 	if badProperties > 0 {
 		feedback.Warn("Bad properties: %d", badProperties)
 	}
@@ -273,6 +267,12 @@
 		feedback.Warn("Unsupported types found: %s", unsupported)
 	}
 
+	if features == 0 {
+		err := errors.New("No features found")
+		feedback.Error("%v", err)
+		return nil, err
+	}
+
 	if err = tx.Commit(); err == nil {
 		feedback.Info("Storing %d features took %s",
 			features, time.Since(start))
--- a/pkg/imports/wx.go	Wed Jan 16 15:29:41 2019 +0100
+++ b/pkg/imports/wx.go	Wed Jan 16 15:35:23 2019 +0100
@@ -264,12 +264,6 @@
 		return nil, err
 	}
 
-	if features == 0 {
-		err := errors.New("No features found")
-		feedback.Error("%v", err)
-		return nil, err
-	}
-
 	if badProperties > 0 {
 		feedback.Warn("Bad properties: %d", badProperties)
 	}
@@ -282,6 +276,12 @@
 		feedback.Warn("Unsupported types found: %s", unsupported)
 	}
 
+	if features == 0 {
+		err := errors.New("No features found")
+		feedback.Error("%v", err)
+		return nil, err
+	}
+
 	if err = tx.Commit(); err == nil {
 		feedback.Info("Storing %d features took %s",
 			features, time.Since(start))