2
0

wrap errors instead of just formatting them

This commit is contained in:
Simon Paredes
2023-11-27 18:53:55 -03:00
committed by Jack Christensen
parent 7ebced92b5
commit 89d699c2e8
10 changed files with 39 additions and 39 deletions
+3 -3
View File
@@ -282,17 +282,17 @@ func (scanPlanTextAnyToDateScanner) Scan(src []byte, dst any) error {
if match != nil {
year, err := strconv.ParseInt(match[1], 10, 32)
if err != nil {
return fmt.Errorf("BUG: cannot parse date that regexp matched (year): %v", err)
return fmt.Errorf("BUG: cannot parse date that regexp matched (year): %w", err)
}
month, err := strconv.ParseInt(match[2], 10, 32)
if err != nil {
return fmt.Errorf("BUG: cannot parse date that regexp matched (month): %v", err)
return fmt.Errorf("BUG: cannot parse date that regexp matched (month): %w", err)
}
day, err := strconv.ParseInt(match[3], 10, 32)
if err != nil {
return fmt.Errorf("BUG: cannot parse date that regexp matched (month): %v", err)
return fmt.Errorf("BUG: cannot parse date that regexp matched (month): %w", err)
}
// BC matched