errors.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package chromedp
  2. // Error is a chromedp error.
  3. type Error string
  4. // Error satisfies the error interface.
  5. func (err Error) Error() string {
  6. return string(err)
  7. }
  8. // Error types.
  9. const (
  10. // ErrInvalidWebsocketMessage is the invalid websocket message.
  11. ErrInvalidWebsocketMessage Error = "invalid websocket message"
  12. // ErrInvalidDimensions is the invalid dimensions error.
  13. ErrInvalidDimensions Error = "invalid dimensions"
  14. // ErrNoResults is the no results error.
  15. ErrNoResults Error = "no results"
  16. // ErrHasResults is the has results error.
  17. ErrHasResults Error = "has results"
  18. // ErrNotVisible is the not visible error.
  19. ErrNotVisible Error = "not visible"
  20. // ErrVisible is the visible error.
  21. ErrVisible Error = "visible"
  22. // ErrDisabled is the disabled error.
  23. ErrDisabled Error = "disabled"
  24. // ErrNotSelected is the not selected error.
  25. ErrNotSelected Error = "not selected"
  26. // ErrInvalidBoxModel is the invalid box model error.
  27. ErrInvalidBoxModel Error = "invalid box model"
  28. // ErrChannelClosed is the channel closed error.
  29. ErrChannelClosed Error = "channel closed"
  30. // ErrInvalidTarget is the invalid target error.
  31. ErrInvalidTarget Error = "invalid target"
  32. // ErrInvalidContext is the invalid context error.
  33. ErrInvalidContext Error = "invalid context"
  34. // ErrPollingTimeout is the error that the timeout reached before the pageFunction returns a truthy value.
  35. ErrPollingTimeout Error = "waiting for function failed: timeout"
  36. // ErrJSUndefined is the error that the type of RemoteObject is "undefined".
  37. ErrJSUndefined Error = "encountered an undefined value"
  38. // ErrJSNull is the error that the value of RemoteObject is null.
  39. ErrJSNull Error = "encountered a null value"
  40. )