fix: ignore nil error for up2date (#552)

This commit is contained in:
李若 2025-09-19 11:29:42 +08:00 committed by GitHub
parent 556282eb0a
commit ed0010f3c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

6
run.go
View File

@ -276,7 +276,11 @@ func Run(options ...*RunOptions) (*Playwright, error) {
}
up2date, err := driver.isUpToDateDriver()
if err != nil || !up2date {
return nil, fmt.Errorf("please install the driver (v%s) first: %w", playwrightCliVersion, err)
ferr := fmt.Errorf("please install the driver (v%s) first", playwrightCliVersion)
if err != nil {
ferr = fmt.Errorf("%w: %w", ferr, err)
}
return nil, ferr
}
connection, err := driver.run()
if err != nil {