CC2.4.5 Crash report?

Hi, in our game the testers meet a random crash (soft-crash, because is javascript VM crashs, so the application still runs); is there a way to show an alert if we have a crash in javascript?

many thanks for support!

Stefano

I will ask engineering to have a look.

Hi Bro

Can you do try catch in your JS codes?

I agreed that it’s very hard to trace error once the game is built/compiled.

You can use se::ScriptEngine::setExceptionCallback to collect JS error reports.

1 Like

Thanks for your support, I will try it sure! :blush:

yep, ok works but now we have a new trouble with:

    se::ScriptEngine *se = se::ScriptEngine::getInstance();
    se->evalString("crashReport('crash??');");

android return E/jswrapper: ScriptEngine::evalString script (no filename), failed!

where could we to write the own crashReport javascript function?

Thanks for help!

do you define the crashReport funciton in global?

yes, inside a file .js, for sample:

export let Smallthing = {
bla bla bla…
}

crashReport = function(message) {

// send crash to server
}

but not only crashReport is not see in envString, but also cc.log is not see. :pensive:

I do a test, but it work!

I wrote this:

and I have this error:

this.pippo() is a foo function to make an error.

and inside file .js

export let Smallthing = {

}

Smallthing.crashReport = function(message) {

}

yes, with console.log works also to me, but not with a game’s method.

you need use a global function, it should work. such as

window.crashReport = function(message) {

}

thanks, for tip, now I try it!

Yes! Now works and we have our crash tracker!
Thanks for help!

Stefano

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.