Return a new error instead of rethrowing a non-existent error
This commit is contained in:
@@ -627,7 +627,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) {
|
||||
case "word": // Word characters
|
||||
nodeToAdd, _ = newEscapedNode('w', true) // This isn't going to error, so I suppress it
|
||||
default:
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("invalid POSIX character class")
|
||||
}
|
||||
chars = append(chars, nodeToAdd)
|
||||
i = temp_i + len(posixClass) + 2 // Skip over the class name, the closing colon and the closing bracket
|
||||
|
Reference in New Issue
Block a user