Skip to content

Commit

Permalink
fix: update error message
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Jan 24, 2024
1 parent 4df400e commit 7bddf06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ func (c *CLI) validateArgs(ctx context.Context, args []string) {
// unmarshalRequest reads input from std.in and unmarshal it into given request struct
func (c *CLI) unmarshalRequest(request plugin.Request) error {
if err := json.NewDecoder(os.Stdin).Decode(request); err != nil {
c.logger.Errorf("%s unmarshalling error :%v", reflect.TypeOf(request), err)
c.logger.Errorf("%s unmarshalling error: %v", reflect.TypeOf(request), err)
return plugin.NewJSONParsingError(plugin.ErrorMsgMalformedInput)
}

if err := request.Validate(); err != nil {
c.logger.Errorf("%s validation error :%v", reflect.TypeOf(request), err)
c.logger.Errorf("%s validation error: %v", reflect.TypeOf(request), err)
var plError *plugin.Error
if errors.As(err, &plError) {
return plugin.NewValidationErrorf("%s: %s", plugin.ErrorMsgMalformedInput, plError.Message)
Expand All @@ -155,7 +155,7 @@ func (c *CLI) unmarshalRequest(request plugin.Request) error {
func (c *CLI) getMetadata(ctx context.Context, p plugin.Plugin) *plugin.GetMetadataResponse {
md, err := p.GetMetadata(ctx, &plugin.GetMetadataRequest{})
if err != nil {
c.logger.Errorf("GetMetadataRequest error :%v", err)
c.logger.Errorf("GetMetadataRequest error: %v", err)
deliverError("Error: Failed to get plugin metadata.")
}
return md
Expand Down

0 comments on commit 7bddf06

Please sign in to comment.