changeset 838:03e966b71a88

cross profile controller: Handle real errors before checking if there is no matching survey.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 28 Sep 2018 10:25:09 +0200
parents 1761694dad4a
children 157a3e42d4af
files pkg/controllers/cross.go
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/cross.go	Fri Sep 28 10:17:31 2018 +0200
+++ b/pkg/controllers/cross.go	Fri Sep 28 10:25:09 2018 +0200
@@ -95,6 +95,11 @@
 		csi.Properties.Bottleneck, csi.Properties.Date.Time,
 		conn, req.Context())
 
+	log.Printf("loading octree took: %s\n", time.Since(start))
+	if err != nil {
+		return
+	}
+
 	if tree == nil {
 		err = JSONError{
 			Code: http.StatusNotFound,
@@ -105,11 +110,6 @@
 		return
 	}
 
-	log.Printf("loading octree took: %s\n", time.Since(start))
-	if err != nil {
-		return
-	}
-
 	// The coordinate system of the octree is an UTM projection.
 	// The input coordinates are in WGS84.
 	// So we need to reproject them.