Class: ErrorEvent

ErrorEvent(type, message, object)

new ErrorEvent(type, message, object)

The Event object supplied to listeners added via MatsSocket#addErrorEventListener().
Parameters:
Name Type Description
type string
message string
object Object
Source:

Members

message :string

The error message
Type:
  • string
Source:

reference :Object

Some errors supply a relevant object: Event for WebSocket errors, The attempted processed MatsSocket Envelope when envelope processing fails, or the caught Error in a try-catch (typically when invoking event listeners). For submitting errors back to the home server, check out ErrorEvent#referenceAsString.
Type:
  • Object
Source:

type :string

Type of error - describes the situation where the error occurred. Currently has no event-type enum.
Type:
  • string
Source:

Methods

referenceAsString(maxLength) → {string}

Makes a string (chopped the specified max number of characters, default 1024 chars) out of the ErrorEvent#reference Object, which might be useful if you want to send this back over HTTP - consider encodeURIComponent(referenceAsString) if you want to send it over the URL. First tries to use JSON.stringify(reference), failing that, it uses ""+reference. Then chops to max 1024, using "..." to denote the chop.
Parameters:
Name Type Description
maxLength number the max number of characters that will be returned, with any chop denoted by "...".
Source:
Returns:
Type
string