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