28 instantiations of RpcFault
Aspire.Hosting.Native.Server (28)
artifacts\obj\Aspire.Hosting.Native.Server\Debug\native-ats\NativeDispatch.g.cs (2)
899throw new RpcFault(exception.Code, exception.Message); 905throw new RpcFault("EXECUTION_PREREQUISITE_CYCLE", exception.Message);
Rpc\RpcFault.cs (26)
12public static RpcFault InvalidArgument(string message) => new("INVALID_ARGUMENT", message); 13public static RpcFault InvalidHandle(string message) => new("INVALID_HANDLE", message); 14public static RpcFault HandleNotFound(string message) => new("HANDLE_NOT_FOUND", message); 15public static RpcFault HandleLimit(string message) => new("HANDLE_LIMIT", message); 16public static RpcFault TypeMismatch(string message) => new("TYPE_MISMATCH", message); 17public static RpcFault UnknownCapability(string message) => new("UNKNOWN_CAPABILITY", message); 18public static RpcFault CapabilityNotFound(string message) => new("CAPABILITY_NOT_FOUND", message); 19public static RpcFault Unauthenticated(string message) => new("UNAUTHENTICATED", message); 20public static RpcFault MethodNotFound(string message) => new("METHOD_NOT_FOUND", message); 21public static RpcFault NotSupported(string message) => new("NOT_SUPPORTED", message); 22public static RpcFault RpcBusy(string message) => new("RPC_BUSY", message); 23public static RpcFault RequestTooLarge(string message) => new("REQUEST_TOO_LARGE", message); 24public static RpcFault ProviderLimit(string message) => new("PROVIDER_LIMIT", message); 25public static RpcFault ProviderRegistrationRejected(string message) => new("PROVIDER_REGISTRATION_REJECTED", message); 26public static RpcFault ProviderConflict(string message) => new("PROVIDER_CONFLICT", message); 27public static RpcFault ProviderTimeout(string message) => new(ProviderTimeoutCode, message); 28public static RpcFault InvalidRequest(string message) => new("INVALID_REQUEST", message); 29public static RpcFault ProviderLifecycleCancelled(string message) => new("PROVIDER_LIFECYCLE_CANCELLED", message); 30public static RpcFault ProviderLifecycleTimeout(string message) => new("PROVIDER_LIFECYCLE_TIMEOUT", message); 31public static RpcFault ProviderLifecycleFailed(string message) => new("PROVIDER_LIFECYCLE_FAILED", message); 32public static RpcFault ProviderDisconnected(string message) => new("PROVIDER_DISCONNECTED", message); 33public static RpcFault ProviderFailed(string message) => new("PROVIDER_FAILED", message); 34public static RpcFault LifecycleAuthorityRequired(string message) => new("LIFECYCLE_AUTHORITY_REQUIRED", message); 35public static RpcFault ProviderDisposalFailed(string message) => new("PROVIDER_DISPOSAL_FAILED", message); 36public static RpcFault ProviderMetadataInvalid(string message) => new("PROVIDER_METADATA_INVALID", message); 37public static RpcFault ProviderMetadataUnsupported(string message) => new("PROVIDER_METADATA_UNSUPPORTED", message);
153 references to RpcFault
Aspire.Hosting.Native.Core.Tests (17)
NativeApplicationLifetimeTests.cs (1)
86Assert.Throws<RpcFault>(() => handles.Add(run, "run"));
NativeProtocolParsingTests.cs (6)
248Assert.Throws<RpcFault>(() => NativeRpcProtocol.ParseRequest(Encoding.UTF8.GetBytes(json))); 274Assert.Throws<RpcFault>(() => NativeRpcProtocol.ParseRequest( 276Assert.Throws<RpcFault>(() => NativeRpcProtocol.ParseRequest( 281Assert.Throws<RpcFault>(() => NativeRpcProtocol.ParseRequest(Encoding.UTF8.GetBytes(padded + " "))); 282Assert.Throws<RpcFault>(() => NativeRpcProtocol.ParseRequest( 284Assert.Throws<RpcFault>(() => NativeRpcProtocol.ParseRequest(
NativeProviderProtocolTests.cs (10)
23var fault = Assert.Throws<RpcFault>(() => Project(metadata)); 103var fault = Assert.Throws<RpcFault>(() => NativeProviderMetadata.Read(JsonNode.Parse(metadata))); 118var fault = Assert.Throws<RpcFault>(() => NativeProviderMetadata.Read(metadata)); 130var fault = Assert.Throws<RpcFault>(() => NativeProviderValueProtocol.ParseReturnedHandle(JsonNode.Parse(wire), type, contract.CoreHandles)); 152var fault = Assert.Throws<RpcFault>(() => contract.Project("example.protocol", parsed));
Aspire.Hosting.Native.Server (136)
artifacts\obj\Aspire.Hosting.Native.Server\Debug\native-ats\NativeDispatch.g.cs (1)
894default: throw RpcFault.CapabilityNotFound("The capability is not implemented.");
Rpc\NativeBackchannelRpc.cs (2)
71catch (Exception exception) when (exception is IOException or SocketException or InvalidDataException or JsonException or RpcFault) 152catch (Exception exception) when (exception is ArgumentException or RpcFault or JsonException)
Rpc\NativeHandles.cs (7)
22throw RpcFault.HandleLimit("The connection handle limit was reached."); 35throw RpcFault.HandleLimit("The connection handle limit was reached."); 49throw RpcFault.InvalidHandle("A capability handle is required."); 56throw RpcFault.HandleNotFound("The capability handle is unknown or retired."); 60throw RpcFault.TypeMismatch("The capability handle is not applicable."); 73throw RpcFault.HandleNotFound("The capability handle is unknown or retired."); 77throw RpcFault.TypeMismatch("The capability handle is not applicable.");
Rpc\NativeProviderContractProjection.cs (8)
20throw RpcFault.InvalidArgument("A portable provider package identity is required."); 34throw RpcFault.ProviderConflict("The provider capability identity is duplicate or outside its package."); 43throw RpcFault.ProviderMetadataInvalid("Provider arguments require distinct required names and types."); 50throw RpcFault.ProviderMetadataUnsupported("Provider callbacks require a result type for writeback."); 67throw RpcFault.ProviderMetadataInvalid("The provider receiver must match its projected handle parameter."); 77throw RpcFault.ProviderMetadataInvalid("Lifecycle metadata requires an owned receiver, one native scope and a void result."); 86throw RpcFault.ProviderMetadataInvalid("A provider resource phase cannot have duplicate capabilities."); 122throw RpcFault.ProviderMetadataUnsupported("Provider contracts support primitive values, typed handles and projected callbacks only.");
Rpc\NativeProviderLifecycle.cs (9)
24throw RpcFault.InvalidHandle("An integration object cannot change its original declaration authority."); 30throw RpcFault.ProviderLimit("Provider object capacity was reached."); 54throw RpcFault.ProviderDisconnected("The lifecycle provider is unavailable."); 60throw RpcFault.InvalidHandle("The lifecycle object or phase authority is unavailable."); 103throw cancellationToken.IsCancellationRequested ? RpcFault.ProviderLifecycleCancelled(message) : 104deadline.IsCancellationRequested ? RpcFault.ProviderLifecycleTimeout(message) : RpcFault.ProviderLifecycleFailed(message); 150throw RpcFault.ProviderDisposalFailed("The provider did not release its retired object."); 161throw RpcFault.ProviderDisposalFailed("The provider object release did not complete.");
Rpc\NativeProviderMetadata.cs (6)
39throw RpcFault.ProviderMetadataInvalid("Provider metadata requires protocol version 2 and bounded capabilities."); 48throw RpcFault.ProviderMetadataInvalid("Provider capability projection is incomplete."); 62throw RpcFault.ProviderMetadataInvalid("Provider arguments require distinct required names and types."); 75throw RpcFault.ProviderMetadataInvalid("Callback projection is incomplete."); 82throw RpcFault.ProviderMetadataInvalid("Callback projection is incomplete."); 113throw RpcFault.ProviderMetadataInvalid("Provider parameter flags must be Boolean values.");
Rpc\NativeProviderRegistry.cs (29)
55throw RpcFault.ProviderLimit("Provider registration capacity was reached."); 77throw RpcFault.ProviderRegistrationRejected("The expected provider registration is unavailable."); 92throw RpcFault.ProviderRegistrationRejected("The expected activation authority is unavailable."); 100throw RpcFault.ProviderConflict("The provider registration conflicts with an existing capability."); 115expected.Completion.TrySetException(RpcFault.ProviderRegistrationRejected("The provider activation failed.")); 128throw RpcFault.ProviderRegistrationRejected("The expected activation authority is unavailable."); 137throw RpcFault.ProviderTimeout("The provider activation deadline was reached."); 159throw RpcFault.ProviderRegistrationRejected("The activation authority belongs to another connection."); 163expected.Completion.TrySetException(RpcFault.ProviderRegistrationRejected("The provider activation was abandoned.")); 201throw RpcFault.UnknownCapability("The capability is not implemented."); 208throw RpcFault.LifecycleAuthorityRequired("Lifecycle capabilities require native phase authority."); 262catch (RpcFault fault) when (fault.FaultCode == RpcFault.ProviderTimeoutCode) 270throw RpcFault.ProviderDisconnected("The provider invocation did not complete; it will not be replayed."); 289throw RpcFault.ProviderDisconnected("The provider authority is no longer available."); 303throw RpcFault.InvalidHandle("A lifecycle scope cannot combine general declaration authority."); 311throw RpcFault.TypeMismatch("Core calls require delegated core authority."); 315throw RpcFault.InvalidHandle("A core call cannot combine different connection authorities."); 332throw RpcFault.InvalidHandle("Provider core calls require delegated connection authority."); 363throw RpcFault.InvalidHandle("Callbacks require a registered provider."); 390var handle = value as JsonObject ?? throw RpcFault.InvalidHandle("A typed handle is required."); 397throw RpcFault.InvalidHandle("The provider resource belongs to another authority."); 404throw RpcFault.TypeMismatch("The value is not an integration-owned resource."); 425throw RpcFault.InvalidHandle("The returned core handle is not delegated by this caller."); 434throw RpcFault.InvalidHandle("Integration resource lifetime must be delegated by its caller."); 438throw RpcFault.InvalidHandle("Integration resource lifetime must be a native resource declaration."); 449throw RpcFault.ProviderDisconnected("The provider is no longer available."); 526private static RpcFault Unavailable() => RpcFault.ProviderDisconnected("The integration provider is unavailable.");
Rpc\NativeProviderValueProtocol.cs (4)
20default: throw RpcFault.TypeMismatch("The provider value does not match its projection."); 28var handle = value as JsonObject ?? throw RpcFault.InvalidHandle("The provider did not return a typed handle."); 34throw RpcFault.TypeMismatch("The provider returned an invalid resource handle."); 38throw RpcFault.InvalidHandle("Integration resource lifetime must be delegated by its caller.");
Rpc\NativeRpcConnection.cs (12)
92throw RpcFault.InvalidHandle("The provider resource lifetime cannot change."); 118catch (Exception exception) when (exception is RpcFault or ObjectDisposedException) { return false; } 135throw RpcFault.HandleLimit("The callback authority limit was reached."); 157throw RpcFault.HandleNotFound("The callback authority is unknown or retired."); 164(_peer ?? throw RpcFault.NotSupported("Bidirectional RPC is not configured.")) 173throw RpcFault.HandleNotFound("The capability owner is retired."); 199var response = await (callbackConnection._peer ?? throw RpcFault.NotSupported("Bidirectional RPC is not configured.")) 207throw RpcFault.InvalidArgument("Authoring callbacks must return void."); 340catch (RpcFault) 374catch (RpcFault fault) 443throw RpcFault.Unauthenticated("Authenticate before using capabilities."); 456_ => throw RpcFault.MethodNotFound("The RPC method is not implemented.")
Rpc\NativeRpcConnection.Dispatch.cs (14)
16throw RpcFault.InvalidArgument("Authentication requires one token."); 35throw RpcFault.InvalidArgument("Server entry-point discovery takes no arguments."); 45throw RpcFault.InvalidArgument("Capability discovery takes no arguments."); 56throw RpcFault.InvalidArgument("AppHost configuration requires an application connection and no arguments."); 66throw RpcFault.MethodNotFound("The RPC method is not implemented."); 72throw RpcFault.InvalidArgument("Bootstrap requires a language and does not support assembly filtering."); 84throw RpcFault.InvalidArgument("Capability invocation requires an ID and an argument object."); 109throw RpcFault.InvalidArgument("Provider discovery takes no arguments."); 115throw RpcFault.InvalidArgument("Expected registration requires an application connection and one package identity."); 121throw RpcFault.InvalidArgument("Provider registration requires one expected authority."); 128throw RpcFault.InvalidArgument("Provider activation requires one expected authority."); 135throw RpcFault.InvalidArgument("Abandoning activation requires one expected authority."); 141throw RpcFault.InvalidArgument("Callback invocation requires its authority and arguments."); 145throw RpcFault.MethodNotFound("The RPC method is not implemented.");
Rpc\NativeRpcPeer.cs (5)
35throw RpcFault.RpcBusy("The peer request limit was reached."); 51throw RpcFault.RequestTooLarge("The request exceeds the size limit."); 63throw RpcFault.ProviderTimeout("The provider invocation deadline was reached."); 124catch (Exception exception) when (exception is IOException or SocketException or InvalidDataException or JsonException or RpcFault) 175completion.TrySetException(RpcFault.ProviderFailed("The provider rejected the invocation."));
Rpc\NativeRpcProtocol.cs (4)
112catch (Exception exception) when (exception is JsonException or RpcFault) 131catch (RpcFault) 193private static RpcFault InvalidRequest() => RpcFault.InvalidRequest("The request shape is invalid.");
Rpc\RpcArguments.cs (9)
17throw RpcFault.InvalidArgument("The capability argument shape is invalid."); 28throw RpcFault.InvalidArgument("A string argument is required."); 32? result : throw RpcFault.InvalidArgument("A boolean argument is required."); 36: throw RpcFault.InvalidArgument("A string array argument is required."); 49throw RpcFault.InvalidArgument("A string or an applicable symbolic handle is required."); 53? result : throw RpcFault.InvalidArgument("An integer argument is required."); 56? result : throw RpcFault.InvalidArgument("An integer argument is required."); 60?? throw RpcFault.InvalidArgument("An object argument is required.") 61: throw RpcFault.InvalidArgument("An object argument is required.");
Rpc\RpcFault.cs (26)
12public static RpcFault InvalidArgument(string message) => new("INVALID_ARGUMENT", message); 13public static RpcFault InvalidHandle(string message) => new("INVALID_HANDLE", message); 14public static RpcFault HandleNotFound(string message) => new("HANDLE_NOT_FOUND", message); 15public static RpcFault HandleLimit(string message) => new("HANDLE_LIMIT", message); 16public static RpcFault TypeMismatch(string message) => new("TYPE_MISMATCH", message); 17public static RpcFault UnknownCapability(string message) => new("UNKNOWN_CAPABILITY", message); 18public static RpcFault CapabilityNotFound(string message) => new("CAPABILITY_NOT_FOUND", message); 19public static RpcFault Unauthenticated(string message) => new("UNAUTHENTICATED", message); 20public static RpcFault MethodNotFound(string message) => new("METHOD_NOT_FOUND", message); 21public static RpcFault NotSupported(string message) => new("NOT_SUPPORTED", message); 22public static RpcFault RpcBusy(string message) => new("RPC_BUSY", message); 23public static RpcFault RequestTooLarge(string message) => new("REQUEST_TOO_LARGE", message); 24public static RpcFault ProviderLimit(string message) => new("PROVIDER_LIMIT", message); 25public static RpcFault ProviderRegistrationRejected(string message) => new("PROVIDER_REGISTRATION_REJECTED", message); 26public static RpcFault ProviderConflict(string message) => new("PROVIDER_CONFLICT", message); 27public static RpcFault ProviderTimeout(string message) => new(ProviderTimeoutCode, message); 28public static RpcFault InvalidRequest(string message) => new("INVALID_REQUEST", message); 29public static RpcFault ProviderLifecycleCancelled(string message) => new("PROVIDER_LIFECYCLE_CANCELLED", message); 30public static RpcFault ProviderLifecycleTimeout(string message) => new("PROVIDER_LIFECYCLE_TIMEOUT", message); 31public static RpcFault ProviderLifecycleFailed(string message) => new("PROVIDER_LIFECYCLE_FAILED", message); 32public static RpcFault ProviderDisconnected(string message) => new("PROVIDER_DISCONNECTED", message); 33public static RpcFault ProviderFailed(string message) => new("PROVIDER_FAILED", message); 34public static RpcFault LifecycleAuthorityRequired(string message) => new("LIFECYCLE_AUTHORITY_REQUIRED", message); 35public static RpcFault ProviderDisposalFailed(string message) => new("PROVIDER_DISPOSAL_FAILED", message); 36public static RpcFault ProviderMetadataInvalid(string message) => new("PROVIDER_METADATA_INVALID", message); 37public static RpcFault ProviderMetadataUnsupported(string message) => new("PROVIDER_METADATA_UNSUPPORTED", message);