The callback of an errored fetch call by the "LensStudio:AssetLibrary".AssetListService.
fetch
"LensStudio:AssetLibrary".Asset.
// ServiceError is populated on response.error when an asset library // request fails (response.ok === false and response.cancelled === false). const provider = this.pluginSystem.findInterface( IAssetLibraryProvider.interfaceId ) as import('LensStudio:AssetLibrary').IAssetLibraryProvider; const envSetting = new EnvironmentSetting(); envSetting.environment = Environment.Production; envSetting.space = Space.Public; // Request a non-existent asset id to force a failure. const response = await provider.assetsByIdsService.fetchAsync( new GetAssetsByIdsRequest(envSetting, ['does-not-exist']) ); if (!response.ok && !response.cancelled && response.error) { console.log('ServiceError description:', response.error.description); } Copy
// ServiceError is populated on response.error when an asset library // request fails (response.ok === false and response.cancelled === false). const provider = this.pluginSystem.findInterface( IAssetLibraryProvider.interfaceId ) as import('LensStudio:AssetLibrary').IAssetLibraryProvider; const envSetting = new EnvironmentSetting(); envSetting.environment = Environment.Production; envSetting.space = Space.Public; // Request a non-existent asset id to force a failure. const response = await provider.assetsByIdsService.fetchAsync( new GetAssetsByIdsRequest(envSetting, ['does-not-exist']) ); if (!response.ok && !response.cancelled && response.error) { console.log('ServiceError description:', response.error.description); }
Protected
Snap Hidden
Readonly
Human-readable message describing the service error.
The callback of an errored
fetchcall by the "LensStudio:AssetLibrary".AssetListService.See
"LensStudio:AssetLibrary".Asset.
Example