The ErrorHandler can be used to to wrap functions with a try/catch
statement. If an exception is thrown, the given error handler function will
be called.
When this object is disposed, it will stop handling exceptions and tracing.
It will also try to restore window.setTimeout and window.setInterval
if it wrapped them. Notice that in the general case, it is not technically
possible to remove the wrapper, because functions have no knowledge of
what they have been assigned to. So the app is responsible for other
forms of unwrapping.