logging / net.corda.common.logging.errorReporting / ErrorCode

ErrorCode

interface ErrorCode<CODES> where CODES : ErrorCodes, CODES : Enum<CODES>

A type representing an error condition.

Error codes should be used in situations where an error is expected and information can be provided back to the user about what they've done wrong. Each error code should have a resource bundle defined for it, which contains set of properties that define the error string in different languages. See the resource bundles in common/logging/src/main/resources/errorReporting for more details.

Properties

code

The error code.

abstract val code: CODES

parameters

Parameters to pass to the string template when reporting this error. The corresponding template that defines the error string in the resource bundle must be expecting this list of parameters. Parameters should be in the order required by the message template - for example, if the message template is "This error has argument {0} and argument {1}", the first element of this list will be placed into {0}.

abstract val parameters: List<Any>