How to catch js errors? CC 3.6.2

Hi, I want to catch js errors in ios/adroid builds.
I try to catch errors in CocosApplication.cpp

But both exception callbacks aren’t called. And ScriptEngine::callExceptionCallback isn’t call too.

Is there a way to track crash in js?

You can try adding the following code to the ts code

let consoleError = window.console.error;
window.console.error = function () {
     console.log("=======>”, JSON.stringify(arguments));
     consoleError && consoleError.apply(window, arguments);

is this suppose to be used for Firebase Crashlytics ?