Skip to content

Commit

Permalink
fix(destinations): Unmarshal spec error messages (#7463)
Browse files Browse the repository at this point in the history
Co-authored-by: Kemal Hadimli <disq@users.noreply.github.com>
Co-authored-by: candiduslynx <candiduslynx@users.noreply.github.com>
  • Loading branch information
3 people committed Jan 31, 2023
1 parent b6a76f1 commit 85450ad
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/destination/azblob/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func New(ctx context.Context, logger zerolog.Logger, spec specs.Destination) (de
}

if err := spec.UnmarshalSpec(&c.pluginSpec); err != nil {
return nil, fmt.Errorf("failed to unmarshal postgresql spec: %w", err)
return nil, fmt.Errorf("failed to unmarshal azblob spec: %w", err)
}
if err := c.pluginSpec.Validate(); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion plugins/destination/csv/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func New(ctx context.Context, logger zerolog.Logger, spec specs.Destination) (de
}

if err := spec.UnmarshalSpec(&c.csvSpec); err != nil {
return nil, fmt.Errorf("failed to unmarshal postgresql spec: %w", err)
return nil, fmt.Errorf("failed to unmarshal csv spec: %w", err)
}
c.csvSpec.SetDefaults()

Expand Down
2 changes: 1 addition & 1 deletion plugins/destination/file/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func New(ctx context.Context, logger zerolog.Logger, spec specs.Destination) (de
}

if err := spec.UnmarshalSpec(&c.pluginSpec); err != nil {
return nil, fmt.Errorf("failed to unmarshal postgresql spec: %w", err)
return nil, fmt.Errorf("failed to unmarshal file spec: %w", err)
}
if err := c.pluginSpec.Validate(); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion plugins/destination/gcs/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func New(ctx context.Context, logger zerolog.Logger, spec specs.Destination) (de
}

if err := spec.UnmarshalSpec(&c.pluginSpec); err != nil {
return nil, fmt.Errorf("failed to unmarshal postgresql spec: %w", err)
return nil, fmt.Errorf("failed to unmarshal gcs spec: %w", err)
}
if err := c.pluginSpec.Validate(); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion plugins/destination/s3/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func New(ctx context.Context, logger zerolog.Logger, spec specs.Destination) (de
}

if err := spec.UnmarshalSpec(&c.pluginSpec); err != nil {
return nil, fmt.Errorf("failed to unmarshal postgresql spec: %w", err)
return nil, fmt.Errorf("failed to unmarshal s3 spec: %w", err)
}
if err := c.pluginSpec.Validate(); err != nil {
return nil, err
Expand Down

0 comments on commit 85450ad

Please sign in to comment.