mirror of
https://github.com/playwright-community/playwright-go.git
synced 2026-06-12 21:01:15 +08:00
30 lines
436 B
Go
30 lines
436 B
Go
package playwright
|
|
|
|
type Error struct {
|
|
Message string
|
|
Stack string
|
|
}
|
|
|
|
func (e *Error) Error() string {
|
|
return e.Message
|
|
}
|
|
|
|
type TimeoutError Error
|
|
|
|
func (e *TimeoutError) Error() string {
|
|
return e.Message
|
|
}
|
|
|
|
func parseError(err errorPayload) error {
|
|
if err.Name == "TimeoutError" {
|
|
return &TimeoutError{
|
|
Message: err.Message,
|
|
Stack: err.Stack,
|
|
}
|
|
}
|
|
return &Error{
|
|
Message: err.Message,
|
|
Stack: err.Stack,
|
|
}
|
|
}
|