ErrorReporter class
Static error reporter that tracks all created D4rtExceptions.
This is used primarily in test modes to detect errors that occurred during script execution.
Errors can be revoked if they are caught and handled gracefully, preventing them from causing test failures.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
errors
→ List<
D4rtException> -
Returns an unmodifiable list of all reported errors.
no setter
- hasErrors → bool
-
Returns true if any errors have been reported.
no setter
- isTrackingEnabled → bool
-
Whether error tracking is currently enabled.
no setter
- report → String
-
Returns a formatted string with all reported errors.
no setter
- reportShort → String
-
Returns a formatted string with all reported errors (without stack traces).
no setter
Static Methods
-
clear(
) → void - Clears all reported errors.
-
disableTracking(
) → void - Temporarily disables error tracking.
-
enableTracking(
) → void - Enables error tracking. Off by default; opt in from tests/REPL.
-
reportError(
D4rtException error, [StackTrace? stackTrace]) → void - Reports an error to the reporter (only if tracking is enabled).
-
revokeAll(
) → void - Revokes all currently tracked errors.
-
revokeError(
D4rtException error) → bool - Revokes (removes) an error from the reporter.