toString method

  1. @override
String toString()
override

Returns a string representation of the exception.

The returned string includes the error code, message, and throwable. Example:

code : 500, message: Server error, exception: SocketException: Connection timed out

Implementation

@override
String toString() {
  return "code : $code, message: $message, exception: $throwable";
}