( id toolspkg.ToolID, message string, err error, )
| 503 | } |
| 504 | |
| 505 | func toolValidationCommandError( |
| 506 | id toolspkg.ToolID, |
| 507 | message string, |
| 508 | err error, |
| 509 | ) *toolCommandError { |
| 510 | reason := toolspkg.ReasonSchemaInvalid |
| 511 | if extracted, ok := toolspkg.ReasonOf(err); ok { |
| 512 | reason = extracted |
| 513 | } |
| 514 | payload := contract.ToolErrorPayload{ |
| 515 | Code: toolspkg.ErrorCodeInvalidInput, |
| 516 | Message: message, |
| 517 | ReasonCodes: []toolspkg.ReasonCode{reason}, |
| 518 | Layer: toolOperatorCLIKey, |
| 519 | } |
| 520 | if id != "" { |
| 521 | payload.ToolID = id |
| 522 | } |
| 523 | return &toolCommandError{ |
| 524 | response: ToolErrorResponseRecord{Error: payload}, |
| 525 | err: fmt.Errorf("%s: %w", message, err), |
| 526 | } |
| 527 | } |
| 528 | |
| 529 | func toolListBundle(response ToolsResponseRecord) outputBundle { |
| 530 | return listBundle( |
no outgoing calls