Versions Compared

Key

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

...

  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.  Error messages should not be defined in the source code but be in configuration files. 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.

...

  • None of the exceptions defined in AsterixDB supports a zero-parameter constructor nor a single string-parameter constructor;
  • In all constructors of the root level exception classes, there should be an error code parameter;
  • No further exceptions should be thrown from constructing an exception defined in AsterixDB. Otherwise, the exception handling will be complicated.
  • All message templates should be tested.
  • New error messages should not be defined in the source code. Instead, they should live in properties files that map error codes to error messages.
    • For error messages used in the hyracks/algebricks code base, please put their templates into hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
    • For error messages used in the asterixdb codebase, please put their templates into asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties

AsterixDB Error code range:

0 --- 999: runtime errors

...