diff --git a/packages/org.gamecult.eve.unity-scene/Runtime/CultMesh/EveUnityCultMeshProviderDiscovery.cs b/packages/org.gamecult.eve.unity-scene/Runtime/CultMesh/EveUnityCultMeshProviderDiscovery.cs index 70efacf..11438de 100644 --- a/packages/org.gamecult.eve.unity-scene/Runtime/CultMesh/EveUnityCultMeshProviderDiscovery.cs +++ b/packages/org.gamecult.eve.unity-scene/Runtime/CultMesh/EveUnityCultMeshProviderDiscovery.cs @@ -59,13 +59,23 @@ namespace GameCult.Eve.UnityScene if (string.IsNullOrWhiteSpace(rendezvousEndpoint)) throw new ArgumentException("Rendezvous endpoint must be non-empty.", nameof(rendezvousEndpoint)); - var response = await CultMesh.CreateVerseDiscoveryClient().FetchAsync( + CultMeshVerseCatalogResponseMessage response; + try + { + response = await CultMesh.CreateVerseDiscoveryClient().FetchAsync( rendezvousEndpoint, new CultMeshVerseCatalogRequestMessage { VerseIds = string.IsNullOrWhiteSpace(verseId) ? null : new[] { verseId }, TransportVersion = "cultmesh.v0" }); + } + catch (Exception error) + { + throw new InvalidOperationException( + $"Could not query CultMesh rendezvous endpoint '{rendezvousEndpoint}'.", + error); + } var candidates = response.Verses .Where(verse => string.IsNullOrWhiteSpace(verseId) || diff --git a/packages/org.gamecult.eve.unity-scene/Tests/Editor/EveUnityCultMeshAssetLookupTests.cs b/packages/org.gamecult.eve.unity-scene/Tests/Editor/EveUnityCultMeshAssetLookupTests.cs index ce69ca5..dfcc159 100644 --- a/packages/org.gamecult.eve.unity-scene/Tests/Editor/EveUnityCultMeshAssetLookupTests.cs +++ b/packages/org.gamecult.eve.unity-scene/Tests/Editor/EveUnityCultMeshAssetLookupTests.cs @@ -2,6 +2,8 @@ using System; using System.Reflection; using System.Collections.Generic; using System.Diagnostics; +using System.Net; +using System.Net.Sockets; using GameCult.Eve.UnityScene; using NUnit.Framework; using UnityEngine; @@ -10,6 +12,21 @@ namespace GameCult.Eve.UnityScene.Tests { public sealed class EveUnityCultMeshAssetLookupTests { + [Test] + public void UnavailableTcpRendezvousIsReportedAsRetryablePreparationFailure() + { + var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + var port = ((IPEndPoint)listener.LocalEndpoint).Port; + listener.Stop(); + + var error = Assert.ThrowsAsync(() => + new EveUnityCultMeshProviderDiscovery().DiscoverAsync($"cultnet+tcp://127.0.0.1:{port}")); + + StringAssert.Contains("Could not query CultMesh rendezvous endpoint", error!.Message); + Assert.That(error.InnerException, Is.TypeOf()); + } + [Test] public void UnpreparedProviderGetterFailsFastWithoutStartingNetworkDiscovery() { diff --git a/packages/org.gamecult.eve.unity-scene/package.json b/packages/org.gamecult.eve.unity-scene/package.json index b95d5d8..d667c4b 100644 --- a/packages/org.gamecult.eve.unity-scene/package.json +++ b/packages/org.gamecult.eve.unity-scene/package.json @@ -1,7 +1,7 @@ { "name": "org.gamecult.eve.unity-scene", "displayName": "Eve Unity Scene Lowering", - "version": "0.3.93", + "version": "0.3.94", "unity": "6000.0", "description": "Provider-agnostic Unity scene shell for gamecult.eve.surface.v1 interactive world surfaces.", "dependencies": {