getErrorMessage method

String getErrorMessage({
  1. required String exceptionType,
  2. required String hint,
})

Constructs the error message for this exception.

Implementation

String getErrorMessage({
  required String exceptionType,
  required String hint,
}) {
  final StringBuffer buffer = StringBuffer(exceptionType);

  if (message != null) {
    buffer.write(": $message");
  }

  buffer.write("\n$hint");

  return buffer.toString();
}