push_exception_handler


Description:

public void push_exception_handler (owned ExceptionHandler handler)

Push an exception handler in this.

Whenever a JavaScript exception happens in the Context, the given handler will be called. The default ExceptionHandler simply calls throw_exception to throw the exception to the Context. If you don't want to catch the exception, but only get notified about it, call throw_exception in handler like the default one does. The last exception handler pushed is the only one used by the Context, use pop_exception_handler to remove it and set the previous one. When handler is removed from the context, destroy_notify i called with user_data as parameter.

Parameters:

this

a Context

handler

a ExceptionHandler

destroy_notify

destroy notifier for user_data

user_data

user data to pass to handler