How to notify FxOS app when the whole app crashed

56 views Asked by At

Is there a way that we can be notified when the whole FxOS app crashes? Because I want to know what causes it to crash or errors.

Thanks.

1

There are 1 answers

2
msaad On

There is no API that will report what crashed your app. Why? Because you should've known better or have treated possible errors offhand.

What I would recommend is that you log your actions somehow. One of your options is using the Console API, which is something like this:

Outputting a single object

var someObject = { str: "Some text", id: 5 }; console.log(someObject);

This will output something like

[09:27:13.475] ({str:"Some text", id:5})

Stack Traces

The console object also supports outputting a stack trace, which will show you the call path taken to reach the point at which you've called console.trace() . It goes like this

foo();

function foo() {
  function bar() {
    console.trace();
  }
  bar();
}

And console will output something like this:

Console.trace()

How to enable console logging on Firefox OS

For more information on how to enable console logging on Firefox OS devices, see this

How to debug apps on Firefox OS

For more information on how to debug apps on Firefox OS, see this