Unverified Commit b10f25c6 authored by Daniel Austin's avatar Daniel Austin Committed by GitHub

implement override of toString() in order to print useful message in release...

implement override of toString() in order to print useful message in release mode as well as debug mode (#118263)

Added `_ErrorDescription.toString()`
parent b3f7699d
......@@ -223,6 +223,13 @@ abstract class _ErrorDiagnostic extends DiagnosticsProperty<List<Object>> {
level: level,
);
@override
String toString({
TextTreeConfiguration? parentConfiguration,
DiagnosticLevel minLevel = DiagnosticLevel.info,
}) {
return valueToString(parentConfiguration: parentConfiguration);
}
@override
List<Object> get value => super.value!;
......
......@@ -16,6 +16,13 @@ void main() {
expect(log[1], contains('debugPrintStack'));
});
test('should show message of ErrorDescription', () {
const String descriptionMessage = 'This is the message';
final ErrorDescription errorDescription = ErrorDescription(descriptionMessage);
expect(errorDescription.toString(), descriptionMessage);
});
test('debugPrintStack', () {
final List<String> log = captureOutput(() {
final FlutterErrorDetails details = FlutterErrorDetails(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment