WebScraperError class

Custom exception class for web scraping operations.

This class represents errors that occur during web scraping operations, such as network failures, parsing errors, configuration issues, or unsupported URL patterns.

The exception includes a descriptive message that explains what went wrong, making it easier to debug and handle errors appropriately.

Example usage:

try {
  final data = await scraper.scrape(url: url, scraperConfigMap: config);
} on WebScraperError catch (e) {
  print('Scraping failed: ${e.message}');
}
Implemented types

Constructors

WebScraperError.new(String message)
Creates a new WebScraperError instance.
WebScraperError.fromJson(String json)
Creates a WebScraperError instance from a JSON string.
factory
WebScraperError.fromMap(Map<String, dynamic> map)
Creates a WebScraperError instance from a Map.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
message String
Descriptive error message explaining what went wrong.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
Converts the WebScraperError instance to a JSON string.
toMap() Map<String, dynamic>
Converts the WebScraperError instance to a Map.
toString() String
Returns a string representation of the error.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited