toJson method

String toJson()

Converts the WebScraperError instance to a JSON string.

This method is used for serializing the error to JSON format.

Returns:

  • JSON string containing the error message

Implementation

String toJson() {
  return jsonEncode(toMap());
}