printStackTrace method

void printStackTrace([
  1. bool useErrorPrint = false
])

Prints the error along with its stack trace.

Implementation

void printStackTrace([bool useErrorPrint = false]) {
  if (useErrorPrint) {
    stderr.write(this);
  } else {
    print(this);
  }

  if (stackTrace != null) {
    if (useErrorPrint) {
      stderr.write(stackTrace);
    } else {
      print(stackTrace);
    }
  }
}