mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -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
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "no such file") ||
|
||||
strings.Contains(err.Error(), "cannot find the file") ||
|
||||
strings.Contains(err.Error(), "cannot find the path") {
|
||||
if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
}
|
||||
return false, err
|
||||
|
||||
Reference in New Issue
Block a user