Exception not caught

This an embarrassing question but - how does exception handling work in Monkey C? In all logic with the code 

  try {
    var n = 0; // compiler complains about forced 0/0 otherwise
    System.println("before");
    var m = 0/n;
    System.println("what?");
  } catch (e) {
    System.println("handling");
  }
System.println("done");

I should see the chain before -> handling -> done. Now I bomb out with an Error: Invalid Value on the div by zero. Isn't catch(e) the catch-all?

According to the docs, Exception.printStackTrace() returns an Object (not String). Is it still String (or how should I collect the stack trace to a String)? I'm thinking of some sort of centralized error reporting to a REST endpoint

Parents
  • how does exception handling work in Monkey C? In all logic with the code 

    Not all errors are exceptions. Some errors are handled by the system by returning an error code and crashing your app.

    Exception support was added to MonkeyC later in its development, and there are some cases where the old error system is still used; dividing by zero is one of those cases.

Reply
  • how does exception handling work in Monkey C? In all logic with the code 

    Not all errors are exceptions. Some errors are handled by the system by returning an error code and crashing your app.

    Exception support was added to MonkeyC later in its development, and there are some cases where the old error system is still used; dividing by zero is one of those cases.

Children
No Data