Skip to main content

LensStudio:Preview.RenderFailed

Class

Pause 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

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

readonly isResumable: boolean

Whether the preview can be resumed from this state. Always true for RenderFailed.


isSuspending

readonly isSuspending: boolean

Whether this reason suspends the preview input. Always true for RenderFailed.


message

readonly message: string

User-facing explanation of the render failure and how to recover.