toString method

  1. @override
String toString()
override

Returns a string representation of the error.

If message is non-empty, includes both the error code and message. Otherwise, returns only the error code as a string.

Implementation

@override
String toString() {
  if (message.isNotEmpty) {
    return 'error:$error --> ($message)';
  }
  return '$error';
}