Improve local dev override docs and add read-only example

This commit is contained in:
beatz174-bit
2026-04-21 17:11:15 +10:00
parent da55eb3c9f
commit d2ad986558
13 changed files with 388 additions and 186 deletions
+23
View File
@@ -0,0 +1,23 @@
package provider
import (
"errors"
"github.com/dynu/terraform-provider-dynu/internal/dynuclient"
)
func diagnosticSummary(defaultSummary string, err error) string {
var apiErr *dynuclient.APIError
if !errors.As(err, &apiErr) {
return defaultSummary
}
switch apiErr.StatusCode {
case 401, 403:
return defaultSummary + " (authentication failed)"
case 404:
return defaultSummary + " (not found)"
default:
return defaultSummary
}
}