| ARRIS Enterprises, Inc. Confidential Information | ||||||||
TOI3 ExceptionsError handling in TOI is done exclusively using exceptions. There are multiple types of exceptions, each signalling a type of error condition. For each method available in TOI, the possible exceptions, if any, are enumerated in the API reference. It is highly advisable to handle these exceptions to avoid erratic application behavior. Exception typesTOI3/JS exceptions are compatible with the built-in
ECMAScript
┌──────────────────────────────────┐
│ Error (ECMAScript built-in type) │
└────┬─────────────────────────────┘
┌────┴─────────┐
│ ToiException │
└────┬─────────┘
├──────────────────────────────┬───────────────────────────────┬──┄┄┄
┌────┴────────────────────────┐ ┌───┴──────────────────────────┐ ┌──┴──┄┄┄
│ ToiInvalidArgumentException │ │ ToiPermissionDeniedException │ │ ...
└─────────────────────────────┘ └──────────────────────────────┘ └─────┄┄┄
Handling exceptionsLike standard exceptions, all TOI exceptions have
The type of exception caught can be determined using
the
It's possible to tell TOI exceptions apart from non-TOI exceptions by
checking if the exception is an
A comparison between TOI2/JS and TOI3/JS exceptionsExceptions in TOI3/JS work slightly different from how they worked in TOI2/JS. They are somewhat easier to use now and work more like how JavaScript programmers expect them to.
|