toMap method

Map<String, dynamic> toMap()

Converts the InfospectNetworkError object into a Map representation.

Returns a Map with the following key-value pairs:

  • 'error': The string representation of the error object using the toString() method.
  • 'stackTrace': The string representation of the stack trace, if available, using toString().

Implementation

Map<String, dynamic> toMap() {
  return <String, dynamic>{
    'error': error.toString(),
    'stackTrace': stackTrace?.toString(),
  };
}