always wrap errors when creating new ones with fmt.Errorf()

It doesn't really change anything in most of the cases, but it's a useful
habit anyway.

Fix #350.
This commit is contained in:
Roman Khimov 2020-08-06 19:09:57 +03:00
parent 205f52c563
commit 0e2784cd2c
24 changed files with 105 additions and 84 deletions

View file

@ -241,7 +241,7 @@ func handleBreak(c *ishell.Context) {
}
n, err := strconv.Atoi(c.Args[0])
if err != nil {
c.Err(fmt.Errorf("argument conversion error: %s", err))
c.Err(fmt.Errorf("argument conversion error: %w", err))
return
}
@ -388,7 +388,7 @@ func handleStep(c *ishell.Context) {
if len(c.Args) > 0 {
n, err = strconv.Atoi(c.Args[0])
if err != nil {
c.Err(fmt.Errorf("argument conversion error: %s", err))
c.Err(fmt.Errorf("argument conversion error: %w", err))
return
}
}