Skip to content

Commit

Permalink
Rename error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprogrammr committed Jun 14, 2024
1 parent c8dad16 commit b1e2b9b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions internal/provider/achievement_localization_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (r *achievementLocalizationResource) Create(ctx context.Context, req resour
achievement, err := r.client.GetAchievementByID(ctx, achievementID)
if err != nil {
resp.Diagnostics.AddError(
"Unable to Read Achievement",
"Failed to read achievement",
err.Error(),
)
return
Expand All @@ -109,7 +109,7 @@ func (r *achievementLocalizationResource) Create(ctx context.Context, req resour
})
if err != nil {
resp.Diagnostics.AddError(
"Unable to Create Achievement Localization",
"Failed to create achievement localization",
err.Error(),
)
return
Expand All @@ -130,7 +130,7 @@ func (r *achievementLocalizationResource) Read(ctx context.Context, req resource
localization, err := r.client.GetAchievementLocalizationByID(ctx, state.ID.ValueString())
if err != nil {
resp.Diagnostics.AddError(
"Unable to Read Achievement Localization",
"Failed to read achievement localization",
err.Error(),
)
return
Expand Down Expand Up @@ -158,7 +158,7 @@ func (r *achievementLocalizationResource) Delete(ctx context.Context, req resour
err := r.client.DeleteAchievementLocalizationByID(ctx, state.ID.ValueString())
if err != nil {
resp.Diagnostics.AddError(
"Unable to Delete Achievement Localization",
"Failed to aelete achievement localization",
err.Error(),
)
return
Expand Down
8 changes: 4 additions & 4 deletions internal/provider/achievement_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (r *achievementResource) Create(ctx context.Context, req resource.CreateReq
gameCenter, err := r.client.GetGameCenterByID(ctx, gameCenterId)
if err != nil {
resp.Diagnostics.AddError(
"Unable to Read Game Center",
"Failed to read game center",
err.Error(),
)
return
Expand All @@ -117,7 +117,7 @@ func (r *achievementResource) Create(ctx context.Context, req resource.CreateReq
response, err := r.client.CreateAchievement(ctx, gameCenter, &achievement)
if err != nil {
resp.Diagnostics.AddError(
"Unable to Create Achievement",
"Failed to create achievement",
err.Error(),
)
return
Expand All @@ -138,7 +138,7 @@ func (r *achievementResource) Read(ctx context.Context, req resource.ReadRequest
achievement, err := r.client.GetAchievementByID(ctx, state.ID.ValueString())
if err != nil {
resp.Diagnostics.AddError(
"Unable to Read Achievement",
"Failed to read achievement",
err.Error(),
)
return
Expand Down Expand Up @@ -167,7 +167,7 @@ func (r *achievementResource) Delete(ctx context.Context, req resource.DeleteReq
err := r.client.DeleteAchievementByID(ctx, state.ID.ValueString())
if err != nil {
resp.Diagnostics.AddError(
"Unable to Delete Achievement",
"Failed to delete achievement",
err.Error(),
)
return
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/app_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (d *appDataSource) Read(ctx context.Context, req datasource.ReadRequest, re
app, err := d.client.GetApp(ctx, appId)
if err != nil {
resp.Diagnostics.AddError(
"Unable to Read App",
"Failed to read app",
err.Error(),
)
return
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/apps_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (d *appsDataSource) Read(ctx context.Context, _ datasource.ReadRequest, res
apps, err := d.client.ListApps(ctx)
if err != nil {
resp.Diagnostics.AddError(
"Unable to Read Apps",
"Failed to read apps",
err.Error(),
)
return
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/game_center_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (d *gameCenterDataSource) Read(ctx context.Context, req datasource.ReadRequ
app, err := d.client.GetApp(ctx, appId)
if err != nil {
resp.Diagnostics.AddError(
"Unable to Read App",
"Failed to read app",
err.Error(),
)
return
Expand All @@ -94,7 +94,7 @@ func (d *gameCenterDataSource) Read(ctx context.Context, req datasource.ReadRequ
gameCenter, err := d.client.GetGameCenter(ctx, app)
if err != nil {
resp.Diagnostics.AddError(
"Unable to Read Game Center",
"Failed to read game center",
err.Error(),
)
return
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (p *appstoreProvider) Configure(ctx context.Context, req provider.Configure
})
if err != nil {
resp.Diagnostics.AddError(
"Unable to create App Store Connect API client",
"Failed to create App Store Connect API client",
"An unexpected error occurred when creating the App Store Connect API client. "+
"If the error is not clear, please contact the provider developers.\n\n"+
"App Store Connect Client Error: "+err.Error(),
Expand Down

0 comments on commit b1e2b9b

Please sign in to comment.