LensStudio:Preview.RenderFailed
ClassPause reason reported when rendering fails several times in a row.
Pause reason reported when rendering fails several times in a row. Fix the Lens, then reload the preview to recover.
Index
Properties
Example
Reload a preview whose rendering failed repeatedly, for example after fixing the Lens.
import { LensPreview } from 'LensStudio:LensPreview';
import { RenderFailed } from 'LensStudio:Preview';
export function recoverFromRenderFailure(preview: LensPreview): boolean {
const reason = preview.pauseReason;
if (!(reason instanceof RenderFailed)) return false;
console.log(`Reloading the Lens: ${reason.message}`);
preview.refresh();
return true;
}
Constructors
Constructor
new RenderFailed():
RenderFailed
Constructs a RenderFailed value with its default message.
Returns
RenderFailed
Properties
isResumable
readonlyisResumable:boolean
Whether the preview can be resumed from this state. Always true for RenderFailed.
isSuspending
readonlyisSuspending:boolean
Whether this reason suspends the preview input. Always true for RenderFailed.
message
readonlymessage:string
User-facing explanation of the render failure and how to recover.