File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ package browser
2
2
3
3
import (
4
4
"errors"
5
+ "fmt"
5
6
"os/exec"
6
7
)
7
8
8
9
func openBrowser (url string ) error {
9
10
err := runCmd ("xdg-open" , url )
10
- if e , ok := err .( * exec. Error ); ok && e . Err == exec .ErrNotFound {
11
- return errors . New ( "xdg-open: command not found - install xdg-utils from ports(8)" )
11
+ if errors . Is ( err , exec .ErrNotFound ) {
12
+ return fmt . Errorf ( "%w - install xdg-utils from ports(8)", err )
12
13
}
13
14
return err
14
15
}
Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ package browser
2
2
3
3
import (
4
4
"errors"
5
+ "fmt"
5
6
"os/exec"
6
7
)
7
8
8
9
func openBrowser (url string ) error {
9
10
err := runCmd ("xdg-open" , url )
10
- if e , ok := err .( * exec. Error ); ok && e . Err == exec .ErrNotFound {
11
- return errors . New ( "xdg-open: command not found - install xdg-utils from ports(8)" )
11
+ if errors . Is ( err , exec .ErrNotFound ) {
12
+ return fmt . Errorf ( "%w - install xdg-utils from ports(8)", err )
12
13
}
13
14
return err
14
15
}
You can’t perform that action at this time.
0 commit comments