Skip to content

Commit

Permalink
feat: cleaner lib openapi error message (#1069)
Browse files Browse the repository at this point in the history
@simplesagar lmk what copy you would like
  • Loading branch information
ryan-timothy-albert authored Nov 6, 2024
1 parent be94096 commit 8cdea95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/run/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ type SourceStep interface {
}

func (e *LintingError) Error() string {
return fmt.Sprintf("linting failed: %s - %s", e.Document, e.Err.Error())
errString := e.Err.Error()
if strings.Contains(e.Err.Error(), "spec type not supported by libopenapi") {
errString = "cannot parse spec: speakeasy supports valid yaml or JSON openapi documents of version 3.0+"
}
return fmt.Sprintf("linting failed: %s - %s", e.Document, errString)
}

func (w *Workflow) RunSource(ctx context.Context, parentStep *workflowTracking.WorkflowStep, sourceID, targetID string) (string, *SourceResult, error) {
Expand Down

0 comments on commit 8cdea95

Please sign in to comment.