diff pkg/imports/errors.go @ 3533:8e083b271fca

Improve error messages if no matching gauge version found Avoid hitting the NOT NULL constraint of the referencing validity column in order to hit the foreign key constraint instead and emit an appropriate error message in all such cases.
author Tom Gottfried <tom@intevation.de>
date Wed, 29 May 2019 18:14:20 +0200
parents e0dabe7b2fcf
children 453f15ba8030
line wrap: on
line diff
--- a/pkg/imports/errors.go	Wed May 29 16:56:56 2019 +0200
+++ b/pkg/imports/errors.go	Wed May 29 18:14:20 2019 +0200
@@ -57,10 +57,10 @@
 		switch err.SchemaName {
 		case "waterway":
 			switch err.TableName {
-			case "gauge_measurements":
+			case "gauge_measurements", "gauge_predictions", "bottlenecks":
 				switch err.ConstraintName {
 				case "gauge_key":
-					return "Referenced gauge is not in database"
+					return "Referenced gauge with matching temporal validity not available"
 				}
 			}
 		}