...

Source file src/github.com/playwright-community/playwright-go/errors.go

Documentation: github.com/playwright-community/playwright-go

     1  package playwright
     2  
     3  // Error represents a Playwright error
     4  type Error struct {
     5  	Name    string
     6  	Message string
     7  	Stack   string
     8  }
     9  
    10  func (e *Error) Error() string {
    11  	return e.Message
    12  }
    13  
    14  // TimeoutError represents a Playwright TimeoutError
    15  type TimeoutError Error
    16  
    17  func (e *TimeoutError) Error() string {
    18  	return e.Message
    19  }
    20  
    21  func parseError(err errorPayload) error {
    22  	if err.Name == "TimeoutError" {
    23  		return &TimeoutError{
    24  			Name:    "TimeoutError",
    25  			Message: err.Message,
    26  			Stack:   err.Stack,
    27  		}
    28  	}
    29  	return &Error{
    30  		Name:    err.Name,
    31  		Message: err.Message,
    32  		Stack:   err.Stack,
    33  	}
    34  }
    35  

View as plain text