Unverified Commit 3f401a19 authored by Lasse R.H. Nielsen's avatar Lasse R.H. Nielsen Committed by GitHub

Ignore uses of soon-to-be deprecated `NullThrownError`. (#105693)

parent a783e422
...@@ -395,8 +395,7 @@ class FlutterErrorDetails with Diagnosticable { ...@@ -395,8 +395,7 @@ class FlutterErrorDetails with Diagnosticable {
/// subsequently be reported using [FlutterError.onError]. /// subsequently be reported using [FlutterError.onError].
/// ///
/// The [exception] must not be null; other arguments can be left to /// The [exception] must not be null; other arguments can be left to
/// their default values. (`throw null` results in a /// their default values.
/// [NullThrownError] exception.)
const FlutterErrorDetails({ const FlutterErrorDetails({
required this.exception, required this.exception,
this.stack, this.stack,
...@@ -671,7 +670,7 @@ class FlutterErrorDetails with Diagnosticable { ...@@ -671,7 +670,7 @@ class FlutterErrorDetails with Diagnosticable {
super.debugFillProperties(properties); super.debugFillProperties(properties);
final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}'); final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}');
final Diagnosticable? diagnosticable = _exceptionToDiagnosticable(); final Diagnosticable? diagnosticable = _exceptionToDiagnosticable();
if (exception is NullThrownError) { if (exception is NullThrownError) { // ignore: deprecated_member_use
properties.add(ErrorDescription('The null value was $verb.')); properties.add(ErrorDescription('The null value was $verb.'));
} else if (exception is num) { } else if (exception is num) {
properties.add(ErrorDescription('The number $exception was $verb.')); properties.add(ErrorDescription('The number $exception was $verb.'));
......
...@@ -60,7 +60,7 @@ void main() { ...@@ -60,7 +60,7 @@ void main() {
); );
expect( expect(
FlutterErrorDetails( FlutterErrorDetails(
exception: NullThrownError(), exception: NullThrownError(), // ignore: deprecated_member_use
library: 'LIBRARY', library: 'LIBRARY',
context: ErrorDescription('CONTEXTING'), context: ErrorDescription('CONTEXTING'),
informationCollector: () sync* { informationCollector: () sync* {
...@@ -113,6 +113,7 @@ void main() { ...@@ -113,6 +113,7 @@ void main() {
'═════════════════════════════════════════════════════════════════\n', '═════════════════════════════════════════════════════════════════\n',
); );
expect( expect(
// ignore: deprecated_member_use
FlutterErrorDetails(exception: NullThrownError()).toString(), FlutterErrorDetails(exception: NullThrownError()).toString(),
'══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════\n' '══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════\n'
'The null value was thrown.\n' 'The null value was thrown.\n'
......
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