Cold Help System: Programming: ColdC Reference Manual: Functions: Error: traceback()


LIST traceback()

This function returns the propogated error stack. The first element in the traceback list is the error condition, the second element is what caused the error. The subsequent errors describe the method call stack from the point of origin. The error condition list is ordered as follows:

  1. ERROR code
  2. STRING explanation
  3. ANY additional

The second element (what caused the error) will vary, depending upon where the error came from. If the error came from an operator, function or native method, it is a two element list:

  1. SYMBOL which is one of 'opcode, 'function or 'native
  2. SYMBOL what operator, or the name of the function/native method.

If the error originated in a method, this list is ordered as:

  1. 'method
  2. SYMBOL method name
  3. OBJNUM current object
  4. OBJNUM defining object
  5. INTEGER line in method

All other elements are ordered as:

  1. ERROR error code
  2. SYMBOL method name
  3. OBJNUM current object
  4. OBJNUM defining object
  5. INTEGER line in method

Keep in mind that the error code will change to ~methoderr when it propogates, unless the propogate expression is used. See the section Errors for more information. A full traceback might look like:

[[~numargs, "Called with no arguments, requires one.", 0],
['function, 'listlen],
[~numargs, 'foo, $brandon, $brandon, 1],
[~methoderr, 'tmp_eval_855796437, $brandon, $brandon, 6]]


error() | rethrow() | throw() | traceback()


the Cold Dark