mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Fix error handling to use os.IsNotExist (#14315)
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -119,9 +119,7 @@ func IsValid(walletDir string) (bool, error) {
|
|||||||
}
|
}
|
||||||
f, err := os.Open(expanded) // #nosec G304
|
f, err := os.Open(expanded) // #nosec G304
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if strings.Contains(err.Error(), "no such file") ||
|
if os.IsNotExist(err) {
|
||||||
strings.Contains(err.Error(), "cannot find the file") ||
|
|
||||||
strings.Contains(err.Error(), "cannot find the path") {
|
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
return false, err
|
return false, err
|
||||||
|
|||||||
Reference in New Issue
Block a user