Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Traditionally, two mechanisms are employed to structure errors: exception classes and error codes. AsterixDB takes a hybrid approach that makes use of the two mechanisms through assigning error codes to each exception and grouping errors in a structured exceptions classes. Following are some technical details on exception handling in AsterixDB.

  1. "Root" exception classes are HyracksDataException for runtime errors and AlgebricksException for compilation errors.
  2. Exeptions declared in throws clause in method signatures must be of those types to avoid wrapping of exceptions to satisfy interfaces.
  3. Every exception should contain an error code that uniquely identifies the error and the error message template. In addition to the error code each exception has a fixed set of parameters that are used to parameterize the error message. The goal of the error code is to enable error messages in different languages, evolution of error messages without breaking error identifiers, and the ability to easily search for problems (and solutions) in search engines.
  4. Subclasses of the root exceptions can be used to simplify the construction of exception objects and to increase readability of the code.