Newer Version Available

This content describes an older version of this product. View Latest

Canvas Exceptions

The Canvas namespace contains exception classes.

All exception classes support built-in methods for returning the error message and exception type. See Exception Class and Built-In Exceptions.

The Canvas namespace contains this exception:

Exception Description
Canvas.CanvasRenderException Use this class in your implementation of Canvas.CanvasLifecycleHandler.onRender(renderContext). To show an error to the user in your onRender() implementation, throw a Canvas.CanvasRenderException, and the canvas framework will render the error message to the user.  This exception will be managed only within the onRender() method.

Example

The following example implementation of onRender() catches a CanvasException that was thrown because a canvas URL was set with a string that exceeded the maximum length. A CanvasRenderException is created and thrown to display the error to the user.
See the Force.com Canvas Developer’s Guide for additional examples that use CanvasRenderException.