DOMException (what the File System Access API throws) satisfies
instanceof Error per WebIDL, so one branch covers it. Cross-realm and
worker Error-like objects use their non-empty message; genuine data
objects are serialized so their fields are not collapsed to [object Object].
Never throws. String(x) raises TypeError: Cannot convert object to primitive value for a null-prototype object, and a hostile message
accessor can throw too; this runs inside catch blocks and logging paths —
a helper whose job is "make this loggable" must not become the thing that
breaks the error handler. Same hazard the debug console's object branch
already guards.
The message from an unknown thrown value.
DOMException(what the File System Access API throws) satisfiesinstanceof Errorper WebIDL, so one branch covers it. Cross-realm and worker Error-like objects use their non-emptymessage; genuine data objects are serialized so their fields are not collapsed to[object Object].Never throws.
String(x)raisesTypeError: Cannot convert object to primitive valuefor a null-prototype object, and a hostilemessageaccessor can throw too; this runs insidecatchblocks and logging paths — a helper whose job is "make this loggable" must not become the thing that breaks the error handler. Same hazard the debug console's object branch already guards.