mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 23:39:48 +00:00
Include [AssertionError.message] in [AssertionError.toString] value.
Fixes #40245 BUG= http://dartbug.com/40245 Change-Id: Ice1e9ff2cd37d32a16918ca2464d2637203361ff Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132640 Auto-Submit: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This commit is contained in:
parent
5a5f4010d5
commit
98bafeeb3a
|
@ -100,8 +100,15 @@ class Error {
|
|||
class AssertionError extends Error {
|
||||
/** Message describing the assertion error. */
|
||||
final Object message;
|
||||
|
||||
AssertionError([this.message]);
|
||||
String toString() => "Assertion failed";
|
||||
|
||||
String toString() {
|
||||
if (message != null) {
|
||||
return "Assertion failed: ${Error.safeToString(message)}";
|
||||
}
|
||||
return "Assertion failed";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -98,8 +98,15 @@ class Error {
|
|||
class AssertionError extends Error {
|
||||
/** Message describing the assertion error. */
|
||||
final Object? message;
|
||||
|
||||
AssertionError([this.message]);
|
||||
String toString() => "Assertion failed";
|
||||
|
||||
String toString() {
|
||||
if (message != null) {
|
||||
return "Assertion failed: ${Error.safeToString(message)}";
|
||||
}
|
||||
return "Assertion failed";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue