exceptionToString static method

String exceptionToString(
  1. Object exception, [
  2. Object? stackTrace,
  3. @Deprecated('No longer supported. Remove this argument.') String? reason
])

Internal use only: Converts a caught angular exception into a string.

NOTE: stackTrace should be typed as StackTrace, but currently is not and there is user code depending on this being more generic. Follow b/162611781.

Implementation

static String exceptionToString(
  Object exception, [
  Object? stackTrace,
  @Deprecated('No longer supported. Remove this argument.') String? reason,
]) {
  final buffer = StringBuffer();
  buffer.writeln('EXCEPTION: $exception');
  if (stackTrace != null) {
    buffer.writeln('STACKTRACE: ');
    buffer.writeln(stackTrace.toString());
  }
  return buffer.toString();
}