-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Customer calling code looks like this
service, err := client.GetService(serviceIdentifier)
if err != nil {
resp.Diagnostics.AddError("opslevel client error", fmt.Sprintf("Unable to read service, got error: %s", err))
return
}
But there are cases where service == nil and service.Id == nil which this doesn't handle which means it passes the client code error handling and they have to do this
service, err := client.GetService(serviceIdentifier)
if err != nil || service == nil || service.Id == nil {
resp.Diagnostics.AddError("opslevel client error", fmt.Sprintf("Unable to read service, got error: %s", err))
return
}
We should fix this by adding a custom "Resource Not Found" error that we emit when service == nil || service.Id == nil but it should be done in the client.GetService function.
Then wash, rinse, repeat for all "get" functions in the opslevel-go client.
Metadata
Metadata
Assignees
Labels
No labels