playwright-go/errors.go
2020-08-17 11:33:12 +02:00

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,
}
}