mirror of
https://github.com/thegeeklab/git-sv.git
synced 2024-11-21 12:00:40 +00:00
revert: "refactor: add error handling for parsing messages"
This reverts commit c6aaac5638
.
issue: #45
This commit is contained in:
parent
c6aaac5638
commit
25458f20f6
@ -256,7 +256,7 @@ func (p MessageProcessorImpl) prepareHeader(header string) (string, error) {
|
||||
match := regex.FindStringSubmatch(header)
|
||||
|
||||
if match == nil || len(match) < index {
|
||||
return header, nil
|
||||
return "", fmt.Errorf("could not find %s regex group in match result for '%s'", messageRegexGroupName, header)
|
||||
}
|
||||
|
||||
return match[index], nil
|
||||
|
@ -534,7 +534,7 @@ func Test_prepareHeader(t *testing.T) {
|
||||
{"matching conventional with selector with group", "Merged PR (\\d+): (?P<header>.*)", "Merged PR 123: feat: something", "feat: something", false},
|
||||
{"matching non-conventional with selector with group", "Merged PR (\\d+): (?P<header>.*)", "Merged PR 123: something", "something", false},
|
||||
{"matching non-conventional with selector without group", "Merged PR (\\d+): (.*)", "Merged PR 123: something", "", true},
|
||||
{"non-matching non-conventional with selector with group", "Merged PR (\\d+): (?P<header>.*)", "something", "something", false},
|
||||
{"non-matching non-conventional with selector with group", "Merged PR (\\d+): (?P<header>.*)", "something", "", true},
|
||||
{"matching non-conventional with invalid regex", "Merged PR (\\d+): (?<header>.*)", "Merged PR 123: something", "", true},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
Loading…
Reference in New Issue
Block a user