From 8fec464c3182640efbd1e47cf4d78b0a8ff96707 Mon Sep 17 00:00:00 2001 From: Andre Harms Date: Wed, 4 Feb 2026 09:02:34 +0100 Subject: [PATCH] feat: enhance error messages for invalid request parameters and not found cases --- .../services/postgresflexalpha/database/datasource.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/stackit/internal/services/postgresflexalpha/database/datasource.go b/stackit/internal/services/postgresflexalpha/database/datasource.go index d6890954..45bd305c 100644 --- a/stackit/internal/services/postgresflexalpha/database/datasource.go +++ b/stackit/internal/services/postgresflexalpha/database/datasource.go @@ -166,7 +166,16 @@ func handleReadError(ctx context.Context, diags *diag.Diagnostics, err error, pr projectId, ), map[int]string{ - http.StatusNotFound: fmt.Sprintf("Database, instance %q, or project %q not found.", instanceId, projectId), + http.StatusBadRequest: fmt.Sprintf( + "Invalid request parameters for project %q and instance %q.", + projectId, + instanceId, + ), + http.StatusNotFound: fmt.Sprintf( + "Database, instance %q, or project %q not found.", + instanceId, + projectId, + ), http.StatusForbidden: fmt.Sprintf("Forbidden access to project %q.", projectId), }, )