Skip to content

Commit

Permalink
feat: return errors if filter specified by flag does not exist.
Browse files Browse the repository at this point in the history
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
  • Loading branch information
matthisholleville committed Apr 11, 2023
1 parent 21dc61c commit dd5824f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/analysis/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package analysis
import (
"context"
"encoding/json"
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -72,6 +73,8 @@ func (a *Analysis) RunAnalysis() error {
return err
}
a.Results = append(a.Results, results...)
} else {
return errors.New(fmt.Sprintf("\"%s\" filter does not exist. Please run k8sgpt filters list.", filter))
}
}
return nil
Expand Down

0 comments on commit dd5824f

Please sign in to comment.