GetItemConfigurations exception

Hi,

Using 2023 R2 SDK.

Using ServerSideCarrosal, we get exceptions when SQL is down and we drag/drop the server side carrosal plugin in SC view.

************** Inner Exception **************

Exception type:VideoOS.Platform.RestApiMIPException

Exception message:GET Unexpected statuscode BadRequest in ‘http://v21.demo.ve5.com/API/rest/v1/mipKinds/8a9f28e8-042e-480d-be46-a690537ecee6/mipItems?definitions&tasks&resources&disabled’ - A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Exception source:VideoOS.Platform

Exception Target Site: MoveNext

at VideoOS.Platform.Proxy.RestApi.RestApiClient.d__28.MoveNext()

************** Outer Exception **************

Exception type:System.AggregateException

Exception message:One or more errors occurred.

Exception source:mscorlib

Exception Target Site: GetResultCore

at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)

at VideoOS.Platform.Proxy.RestApi.RestApiClient.GetResources(String resourceType, String id, String childResourceType)

at VideoOS.Platform.Proxy.RestApi.RestApiClientDecorator.CallWithRetry[TResult](Func`2 call)

at VideoOS.Platform.Proxy.RestApi.RestApiClientDecorator.GetChildItems(String path)

at VideoOS.Platform.Proxy.ConfigApi.ConfigurationApiItemWrapper.Children()

at VideoOS.Platform.ConfigurationItems.MIPItemFolder.get_MIPItems()

at VideoOS.Platform.Configuration.GetItemConfigurationsBase(ServerId serverId, Item parentItem, Guid itemKind)

************** System Info **************

Date and time: 12/10/2023 9:55:43 PM

Machine Name: V21

Processors count: 24

OS version: Microsoft Windows NT 6.2.9200.0

64 bit OS: True

64 bit process: True

IP address: fe80::c418:2a8c:813a:2b69%13 (V21.demo.ve25.com)

Current user: V21\vegad

ServerSideCarrosal is a sample. In general the samples are kept simple and might not include error handling. For production code you might want to develop a better error handling.

We have put a try/catch block in serversidecarrosal. But still not able to catch exceptions. Is there any better way?

public Guid SelectedCarrouselId
{
 
	get { return _selectedCarrouselId; }
	set
	{
		try
		{
			if (_selectedCarrouselId != value)
			{
				_selectedCarrouselId = value;
				SetProperty("SelectedGUID", _selectedCarrouselId.ToString());
 
				Item item = Configuration.Instance.GetItemConfiguration(ServerSideCarrouselDefinition.CarrouselPluginId, ServerSideCarrouselDefinition.CarrouselKind, _selectedCarrouselId);
				CarrouselConfigUtil.BuildCarrouselList(item, CarrouselItems);
 
				SaveProperties();       // Moved down to after the re-build of camera list
			}
		}
		catch (Exception ex)
		{
			MessageBox.Show("Error");
		}
    }
}
 
private void OnLoad(object sender, EventArgs e)
{
	try
	{
		List<Item> items = Configuration.Instance.GetItemConfigurations(ServerSideCarrouselDefinition.CarrouselPluginId, null, ServerSideCarrouselDefinition.CarrouselKind);
		FillContent(items, _carrouselViewItemManager.SelectedCarrouselId);
	}
	catch (Exception ex)
	{
		MessageBox.Show("Error OnLoad");
	}
}

When I first answered I assumed you would be able to catch the exception and avoid the end-user seeing it. With your observation we found that the end-user dialog cannot be avoided, however you should be able to control what happens after the end-user has acknowledge the dialog by catching the exception then. I hope this will better fit your observations.