errorToString static method

String errorToString(
  1. Object o, [
  2. StackTrace? stackTrace
])

Implementation

static String errorToString(Object o, [StackTrace? stackTrace]) {
  String errStr;
  if (o is Error) {
    errStr = 'AudioPlayers Error: $o\n${o.stackTrace}';
  } else if (o is Exception) {
    errStr = 'AudioPlayers Exception: $o';
  } else {
    errStr = 'AudioPlayers throw: $o';
  }
  if (stackTrace != null && stackTrace.toString().isNotEmpty) {
    errStr += '\n$stackTrace';
  }
  return errStr;
}