extractUnhandledExceptionMessage method

String extractUnhandledExceptionMessage(
  1. String rawError
)

Tries to extract the useful part from an unhandled exception message.

If no message could be extracted, returns the whole original error.

Implementation

String extractUnhandledExceptionMessage(String rawError) {
  final match = _exceptionMessagePattern.firstMatch(rawError);
  final shortError = match?.group(1);
  return shortError ?? rawError;
}