Newer Version Available
Handling Errors in Your Container
This example uses the same code as the examples in Using a Third-Party Framework and Sending Messages from the Lightning Container Component.
In this component, the onerror attribute of lightning:container specifies handleError as the error handling method. To display the error, the component markup uses a conditional statement, and another attribute, error, for holding an error message.
This is the component’s controller.
If the Lightning container application throws an error, the error handling function sets the error attribute. Then, in the component markup, the conditional expression checks if the error attribute is empty. If it isn’t, the component populates a lightning:textarea element with the error message stored in error.