app/helpers/app_errorhandling_init
library
Functions
-
appInitErrorHandling()
→ Future<void>
-
-
bufferEarlyErrorForTest(Object error, [StackTrace? stackTrace])
→ void
-
Test-only seam to push an error into the buffer as the early handlers would,
so the bounded-buffer / flush tests do not need to drive real
FlutterError.onError (Issue 16/82).
-
configureErrorReporting(ErrorReportingConfig config)
→ void
-
Configure error reporting before calling appInitErrorHandling()
-
installEarlyErrorHandlers()
→ void
-
Installs synchronous, dependency-free error handlers that BUFFER caught
errors into a bounded module-level list until the reporter attaches.
-
recordCapturedError(Object error, StackTrace? stackTrace)
→ void
-
Public production entry point into the single error chokepoint.
-
recordErrorSafeForTest(Object error, [StackTrace? stackTrace])
→ void
-
Test-only seam: route an
(error, stackTrace) through the real chokepoint so
the re-entrancy / dedup / buffering behavior can be unit-tested without
driving a real isolate/zone/web-JS surface (mirrors bufferEarlyErrorForTest
but exercises the full _recordErrorSafe path).
-
reportBootstrapDiagnostic(Object error, String message, [StackTrace? stackTrace])
→ void
-
Reports a bootstrap-time diagnostic that may fire BEFORE the error reporter
is attached, ensuring every consumer's backend captures it.
-
resetEarlyErrorHandlersForTest()
→ void
-
Resets the early-error buffer state for tests. The buffer and the
installed-flag are module-level statics that persist across test cases in
one VM, so without a reset the buffer/flush assertions become order-
dependent (Issue 63).
-
resetIsolateErrorListenerFlag()
→ void
-
Resets the isolate error-listener apply-once flag (Issue 31/63) so the
"added at most once across retries" assertion is order-independent. Internal
test-support seam invoked only by the combined
resetDreamicBootstrapIdempotencyForTest() (the documented
@visibleForTesting entry point) — not @visibleForTesting itself so the
combined reset can call it without a cross-file visibility-lint warning.
-
resetRecordErrorSafeStateForTest()
→ void
-
Test-only reset of the chokepoint module state (re-entrancy guard, dedup set,
active reporter) so module-level statics do not leak across test cases.
-
setActiveReporterForTest(ErrorReporter? reporter)
→ void
-
Test-only seam: install a reporter as the active chokepoint target without
running the whole appInitErrorHandling branch, so
_recordErrorSafe's
attached-vs-buffering split can be exercised in isolation. Pass null to
simulate the pre-attach (unattached) state.