matssocket
Version:
MatsSocket client library
52 lines • 2.02 kB
TypeScript
/**
* The Event object supplied to listeners added via {@link MatsSocket#addErrorEventListener()}.
*
* @param type {string}
* @param message {string}
* @param object {Object}
* @class
*/
export function ErrorEvent(type: string, message: string, object: any): void;
export class ErrorEvent {
/**
* The Event object supplied to listeners added via {@link MatsSocket#addErrorEventListener()}.
*
* @param type {string}
* @param message {string}
* @param object {Object}
* @class
*/
constructor(type: string, message: string, object: any);
/**
* Type of error - describes the situation where the error occurred. Currently has no event-type enum.
*
* @type {string}
*/
type: string;
/**
* The error message
*
* @type {string}
*/
message: string;
/**
* 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).
* <b>For submitting errors back to the home server, check out {@link ErrorEvent#referenceAsString}.</b>
*
* @type {Object}
*/
reference: any;
/**
* Makes a string (<b>chopped the specified max number of characters, default 1024 chars</b>) out of the
* {@link ErrorEvent#reference} Object, which might be useful if you want to send this back over HTTP - consider
* <code>encodeURIComponent(referenceAsString)</code> if you want to send it over the URL. First tries to use
* <code>JSON.stringify(reference)</code>, failing that, it uses <code>""+reference</code>. Then chops to max
* 1024, using "..." to denote the chop.
*
* @param {number} maxLength the max number of characters that will be returned, with any chop denoted by "...".
* @returns {string}
*/
referenceAsString: (maxLength?: number) => string;
}
//# sourceMappingURL=ErrorEvent.d.ts.map