DCL

An elegant OOP with mixins + AOP for JavaScript.

dcl.DclError

Version 2.x

dcl.DclError serves as the base class for all other exceptions thrown by dcl. It can be used to identify dcl-produced errors. It is present only when dcl/debug is imported. Otherwise, Error will be thrown.

Examples

dcl.DclError
1
2
3
4
5
6
7
8
9
var dcl = require("dcl/debug");

try {
  // ... dcl-related code
} catch (e) {
  if (e instanceof dcl.DclError) {
    // special treatment
  }
}

Other exceptions are based on it:

  • dcl.CycleError - thrown when there is an unresolvable cycle in list of declared bases
  • dcl.SuperError - thrown when the next-in-line property is not a function, and a super call cannot be made
  • dcl.ChainingError - thrown when composing a class with different chaining directives for the same method