Get or create
JSErrorReport from an exception object.
JSErrorReport * JS_ErrorFromException(JSContext *cx, JS::HandleObject obj);
||Pointer to a JS context whose errors should be reported via your function. Other contexts in the same runtime can have their own error reporting functions.|
||An exception object.|
obj is an exception object, the exception will have (or be able to lazily create) an error report struct, and
JS_ErrorFromException will return the address of that struct. Otherwise, it returns
nullptr. The lifetime of the error report struct that might be returned is the same as the lifetime of the exception object.