feat: enhance error messages for invalid request parameters and not found cases
This commit is contained in:
parent
6c4ef0f8ac
commit
8fec464c31
1 changed files with 10 additions and 1 deletions
|
|
@ -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),
|
||||
},
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue