detailedMessage property

String get detailedMessage

Accumulates all available failure properties into a comprehensive, multiline diagnostic string.

Useful for logs or crash tracking reports where raw stack traces and root causes are required.

Implementation

String get detailedMessage {
  // Utilize StringBuffer for efficient string concatenation.
  final buffer = StringBuffer('Failure: $message');
  if (error != null) {
    buffer.write('\nError: $error');
  }
  if (stackTrace != null) {
    buffer.write('\nStackTrace: $stackTrace');
  }
  return buffer.toString();
}