WebJsError class

A web JavaScript error serialized into a typed, platform-agnostic Dart object (ERH-010).

Lives in its own (non-js_interop) file so it compiles on all targets — the web handler module (web_error_handlers_web.dart) constructs it from a real ErrorEvent/PromiseRejectionEvent, while VM/mobile tests can reference the type directly.

Fidelity is load-bearing for two downstream consumers:

  • Redaction operates on message, so it is preserved verbatim (the JS error.message / ErrorEvent.message).
  • Dedup + cloud symbolication key on stack, which the handler parses from the JS error.stack via StackTrace.fromString (falling back to StackTrace.current when the JS value carries no stack).

Constructors

WebJsError(String message, String? name, StackTrace stack)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
message String
The JS error message, preserved verbatim for redaction.
final
name String?
The JS Error.name (e.g. NotAllowedError, TypeError) when available.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stack StackTrace
The parsed JS stack (StackTrace.fromString(error.stack)), or StackTrace.current when the JS value carried no stack.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited