Error Streams

Error streams gather errors and the records that caused them.

Description

The error stream provides a means to capture error information along with the data that caused the error. This can assist in debugging errors during development. It can also provide real-time monitoring of projects in a production environment.

You can specify more than one error stream in a single project.

An error stream is identical to other user-defined streams, except it:
  • Receives records from its source stream or window only when there is an error on the source stream or window. The record it receives is the input to the source stream or window that caused the error.
  • Has a predefined schema that cannot be altered by the user.

Schema

Column Datatype Description
errorCode integer The numeric code for the error that was reported
errorRecord binary The record that caused the error
errorMessage string Plain text message describing the error
errorStreamName string The name of the stream on which this error was reported
sourceStreamName string The name of the stream that sent the record that caused the error
errorTime bigdatetime The time the error occurred: a microsecond granularity timestamp

Error Codes and Corresponding Values

Limitations

The syntax of the error stream provides a mechanism for trapping runtime errors, subject to these limitations:
  • Only errors that occur during record computation are captured in error streams. Errors in computations that occur at server start-up, such as evaluation of expressions used to initialize variables and parameters, are not propagated to error streams. Other errors, such as connection errors and noncomputational errors, are not captured in error streams.
  • Errors occurring during computations that happen without a triggering record, such as in the ON START TRANS and ON END TRANS blocks of a flex block, propagate an error record where the errorRecord field contains an empty record.
  • For the recordDataToRecord built-in, the stream name must be a string literal constant. This limitation is so that a record type of the return value of the built-in can be determined during compilation.
  • The triggering record must be retrieved using provided built-ins. No native nested record support is provided to refer to the record directly.
  • The triggering record reported is the immediate input for the stream in which the error happened. This may be a user-defined stream or an intermediate stream generated by the compiler. When using the recordDataToString and recordDataToRecord built-ins, the first argument must match the intermediate stream if one has been generated.
  • The subscription utility does not automatically decrypt (convert from binary to ASCII) the error record.
  • Output adapters do not automatically decrypt (convert from binary to ASCII) the error record.
  • Arithmetic and conversion errors occurring in external functions (C and Java) are not handled; such errors are the users responsibility.
  • Error streams are not guaranteed to work within the debugger framework.