Skip to content

Commit

Permalink
More informative panic on pattern not found
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Oct 2, 2019
1 parent 87a51bd commit f82d439
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ func collect(inputPath, outputPath string) *schema.Dependencies {
fileStr := rif.readFile()
submatches := regex.FindStringSubmatch(fileStr)

if len(submatches) < 1 {
panic(fmt.Errorf("Pattern not found in file\n\n Pattern: %s\n Filename: %s", rif.Pattern, rif.Filename))
}

currentVersion := submatches[1]

if currentVersion == "" {
Expand Down

0 comments on commit f82d439

Please sign in to comment.