onError( )


Adds an event handler that runs when an error occurs.

An error can occur when attempting to resubscribe after a disconnection. Errors that occur during the initial subscription process cause the Promise returned by the subscribe() function to reject and do not trigger onError() event handlers.

Method Declaration
Copy
Method Parameters
handlerfunctionRequired

handler(error: Error): void The name of the function or the function expression to run when an error occurs.

Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?