extractEvaluationErrorMessage method

String extractEvaluationErrorMessage(
  1. String rawError
)

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

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

Implementation

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