Skip to content

Commit 885d948

Browse files
Apply suggestions from code review
Co-Authored-By: Greg Littlefield <greg.littlefield@workiva.com>
1 parent 3258d61 commit 885d948

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/src/component/error_boundary.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class ErrorBoundaryComponent<T extends ErrorBoundaryProps, S extends ErrorBounda
139139
}) {
140140
if (!props.shouldLogErrors) return;
141141

142-
String message = 'An unrecoverable error was caught by an ErrorBoundary (attempting to remount it was unsuccessful): \nInfo: ${info.componentStack}';
142+
final message = 'An unrecoverable error was caught by an ErrorBoundary (attempting to remount it was unsuccessful): \nInfo: ${info.componentStack}';
143143

144144
(props.logger ?? Logger(_loggerName)).severe(message, error, info.dartStackTrace);
145145
}

test/over_react/component/shared_error_boundary_tests.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import './fixtures/flawed_component_on_mount.dart';
1010
import './fixtures/flawed_component_that_renders_a_string.dart';
1111
import './fixtures/flawed_component_that_renders_nothing.dart';
1212

13-
/// `isWrapper` identifies an ErrorBoundary that wraps another Error Boundary in order to handle
13+
/// [isWrapper] identifies an ErrorBoundary that wraps another Error Boundary in order to handle
1414
/// render cycle "unrecoverable" errors.
1515
void sharedErrorBoundaryTests(BuilderOnlyUiFactory<ErrorBoundaryPropsMixin> builder, { bool isWrapper = false }) {
1616
TestJacket<ErrorBoundaryApi> jacket;
@@ -268,7 +268,7 @@ void sharedErrorBoundaryTests(BuilderOnlyUiFactory<ErrorBoundaryPropsMixin> buil
268268

269269
// At this point the component is "Unrecoverable"
270270
if (calls.length > 1) {
271-
expect(calls[calls.length - 1].keys.single, 'onComponentIsUnrecoverable', reason: 'test setup sanity check');
271+
expect(calls.last.keys.single, 'onComponentIsUnrecoverable', reason: 'test setup sanity check');
272272
final componentIsUnrecoverableCallbackArguments = calls[1]['onComponentIsUnrecoverable'];
273273
if (componentIsUnrecoverableCallbackArguments != null) {
274274
errorSentToComponentIsUnrecoverableCallback = componentIsUnrecoverableCallbackArguments[0];

0 commit comments

Comments
 (0)