OtpAppException Data Type

When an error situation happens inside OTP this exception can be used to terminate OTP or the current request http server). The message should contain enough information to the user to fix the problem. Before OTP terminates the message will be logged WITHOUT any stacktrace.

Typical use cases for this exception is:

  • The configuration is not correct.
  • The input data is missing or have severe errors and can not be processed. The later may be difficult to verify, in which case another exception would be a better choice.
  • The command line parameters donĀ“t match the input files.
  • When a exception occurs it is preferable to catch it at the right level, were most context information is available. At this point the exception should be logged with a stacktrace. Then this exception can be re-thrown to terminate the application or request.

Do not use this exception to terminate OTP in case of an unknown/unexpected event, then the IllegalArgumentException, IllegalStateException or RuntimeException should be used. These will be logged with a stacktrace.

Implemented Interfaces
Serializable
Properties
name data type description
Properties inherited from Throwable
message string
cause Throwable
localizedMessage string
stackTrace array of StackTraceElement
suppressed array of Throwable

Example

{
  "message" : "...",
  "cause" : {
    "message" : "...",
    "cause" : { },
    "localizedMessage" : "...",
    "stackTrace" : [ {
      "classLoaderName" : "...",
      "fileName" : "...",
      "nativeMethod" : true,
      "moduleName" : "...",
      "lineNumber" : 12345,
      "className" : "...",
      "moduleVersion" : "...",
      "methodName" : "..."
    }, {
      "classLoaderName" : "...",
      "fileName" : "...",
      "nativeMethod" : true,
      "moduleName" : "...",
      "lineNumber" : 12345,
      "className" : "...",
      "moduleVersion" : "...",
      "methodName" : "..."
    } ],
    "suppressed" : [ { }, { } ]
  },
  "localizedMessage" : "...",
  "stackTrace" : [ {
    "classLoaderName" : "...",
    "fileName" : "...",
    "nativeMethod" : true,
    "moduleName" : "...",
    "lineNumber" : 12345,
    "className" : "...",
    "moduleVersion" : "...",
    "methodName" : "..."
  }, {
    "classLoaderName" : "...",
    "fileName" : "...",
    "nativeMethod" : true,
    "moduleName" : "...",
    "lineNumber" : 12345,
    "className" : "...",
    "moduleVersion" : "...",
    "methodName" : "..."
  } ],
  "suppressed" : [ {
    "message" : "...",
    "cause" : { },
    "localizedMessage" : "...",
    "stackTrace" : [ {
      "classLoaderName" : "...",
      "fileName" : "...",
      "nativeMethod" : true,
      "moduleName" : "...",
      "lineNumber" : 12345,
      "className" : "...",
      "moduleVersion" : "...",
      "methodName" : "..."
    }, {
      "classLoaderName" : "...",
      "fileName" : "...",
      "nativeMethod" : true,
      "moduleName" : "...",
      "lineNumber" : 12345,
      "className" : "...",
      "moduleVersion" : "...",
      "methodName" : "..."
    } ],
    "suppressed" : [ { }, { } ]
  }, {
    "message" : "...",
    "cause" : { },
    "localizedMessage" : "...",
    "stackTrace" : [ {
      "classLoaderName" : "...",
      "fileName" : "...",
      "nativeMethod" : true,
      "moduleName" : "...",
      "lineNumber" : 12345,
      "className" : "...",
      "moduleVersion" : "...",
      "methodName" : "..."
    }, {
      "classLoaderName" : "...",
      "fileName" : "...",
      "nativeMethod" : true,
      "moduleName" : "...",
      "lineNumber" : 12345,
      "className" : "...",
      "moduleVersion" : "...",
      "methodName" : "..."
    } ],
    "suppressed" : [ { }, { } ]
  } ]
}