Options
All
  • Public
  • Public/Protected
  • All
Menu

Defines event data format for returning a result or error from executing a remote operation call.

Hierarchy

  • CommunicationEventData
    • ReturnEventData

Index

Constructors

constructor

  • new ReturnEventData(result?: any, error?: { code: number; message: string }, executionInfo?: any): ReturnEventData
  • Create an instance of ReturnEventData.

    Exactly one of the parameters result or error is required. The executionInfo parameter is optional and may be specified both in case of success and error.

    Parameters

    • Optional result: any

      the result value to be returned (any JSON data type, optional)

    • Optional error: { code: number; message: string }

      the error object in case of failure (optional)

      • code: number
      • message: string
    • Optional executionInfo: any

      information about execution environment (optional)

    Returns ReturnEventData

Accessors

error

  • get error(): { code: number; message: string }
  • The error object to be returned in case the operation call yielded an error (optional). The value is undefined if the operation executed successfully.

    The error object consists of two properties: code, message.

    The error code given is an integer that indicates the error type that occurred, either a predefined error or an application defined one. Predefined error codes are defined by the RemoteCallErrorCode enum. Predefined error codes are within the range -32768 to -32000. Application defined error codes must be defined outside this range.

    The error message provides a short description of the error. Predefined error messages exist for all predefined error codes (see enum RemoteCallErrorMessage).

    Returns { code: number; message: string }

    • code: number
    • message: string

executionInfo

  • get executionInfo(): any
  • Defines additional information about the execution environment (ayn JSON value) such as the execution time of the operation or the ID of the operated control unit (optional).

    The value is undefined, if no execution info has been specified.

    Returns any

isError

  • get isError(): boolean
  • Determines whether an error object has been returned.

    Returns true, if remote operation failed with an error; false otherwise.

    Returns boolean

result

  • get result(): any
  • The result value to be returned (any JSON data type). The value is undefined, if operation execution yielded an error.

    Returns any

Methods

toJsonObject

  • toJsonObject(): { error: { code: number; message: string }; executionInfo: any; result: any }
  • Returns { error: { code: number; message: string }; executionInfo: any; result: any }

    • error: { code: number; message: string }
      • code: number
      • message: string
    • executionInfo: any
    • result: any

Static createFrom

Generated using TypeDoc